Skip to content

Commit 850f24f

Browse files
committed
localai_api_key is optional
1 parent 351d238 commit 850f24f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

processors/providers/promptly/text_chat.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,9 @@ def process(self) -> dict:
238238
temperature=self._config.temperature,
239239
stream=True,
240240
)
241-
elif self._env['localai_api_key'] and self._env['localai_base_url'] and self._config.use_localai_if_available:
242-
openai.api_key = self._env['localai_api_key']
241+
elif self._env['localai_base_url'] and self._config.use_localai_if_available:
242+
if self._env['localai_api_key']:
243+
openai.api_key = self._env['localai_api_key']
243244
openai.api_base = self._env['localai_base_url']
244245
model = self._config.dict().get('model', 'gpt-3.5-turbo')
245246

0 commit comments

Comments
 (0)