Skip to content

Commit

Permalink
localai_api_key is optional
Browse files Browse the repository at this point in the history
  • Loading branch information
ajhai committed Sep 21, 2023
1 parent 351d238 commit 850f24f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions processors/providers/promptly/text_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,9 @@ def process(self) -> dict:
temperature=self._config.temperature,
stream=True,
)
elif self._env['localai_api_key'] and self._env['localai_base_url'] and self._config.use_localai_if_available:
openai.api_key = self._env['localai_api_key']
elif self._env['localai_base_url'] and self._config.use_localai_if_available:
if self._env['localai_api_key']:
openai.api_key = self._env['localai_api_key']
openai.api_base = self._env['localai_base_url']
model = self._config.dict().get('model', 'gpt-3.5-turbo')

Expand Down

0 comments on commit 850f24f

Please sign in to comment.