We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d1fe9c5 commit a2db208Copy full SHA for a2db208
1 file changed
aipyapp/aipy/llm.py
@@ -168,14 +168,14 @@ def _parse_response(self, response):
168
)
169
170
def get_completion(self, messages):
171
- stream_options = {'include_usage': True} if self._stream else None
+ kws = {'stream_options': {'include_usage': True}} if self._stream and not self._base_url else {}
172
try:
173
response = self._client.chat.completions.create(
174
model = self._model,
175
messages = messages,
176
stream=self._stream,
177
- stream_options = stream_options,
178
- max_tokens = self.max_tokens
+ max_tokens = self.max_tokens,
+ **kws
179
180
except Exception as e:
181
self.console.print(f"❌ [bold red]{self.name} API {T('call_failed')}: [yellow]{str(e)}")
0 commit comments