修正错误的逻辑

This commit is contained in:
2025-09-11 08:31:01 +08:00
parent 2f5757e3fb
commit 0af78ccb67
+2 -2
View File
@@ -176,7 +176,7 @@ class OpenAiLLM:
kwargs.update(extra_kwargs) kwargs.update(extra_kwargs)
if "timeout" not in self._kwargs: if "timeout" not in self._kwargs:
timeout = httpx.Timeout(300.0) timeout = httpx.Timeout(300.0)
self._kwargs["timeout"] = timeout kwargs["timeout"] = timeout
if api_key is None: if api_key is None:
api_key = APIKeyManager.get_api_key() api_key = APIKeyManager.get_api_key()
@@ -188,7 +188,7 @@ class OpenAiLLM:
completion = client.chat.completions.create( completion = client.chat.completions.create(
model=self._model, model=self._model,
messages=[{'role': 'user', 'content': user_prompt}], messages=[{'role': 'user', 'content': user_prompt}],
**self._kwargs **kwargs
) )
return completion.choices[0].message return completion.choices[0].message
except Exception as e: except Exception as e: