mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-02 03:55:55 +00:00
fix: f the stream resp
This commit is contained in:
@@ -61,7 +61,7 @@ class OpenAIChatCompletions(requester.LLMAPIRequester):
|
||||
|
||||
async for chunk in resp_gen:
|
||||
# print(chunk)
|
||||
if not chunk:
|
||||
if not chunk or not chunk.id or not chunk.choices or not chunk.choices[0] or not chunk.choices[0].delta:
|
||||
continue
|
||||
|
||||
if chunk.choices[0].delta.content is not None:
|
||||
@@ -75,6 +75,9 @@ class OpenAIChatCompletions(requester.LLMAPIRequester):
|
||||
break
|
||||
else:
|
||||
tool_calls.append(tool_call)
|
||||
|
||||
if chunk.choices[0].finish_reason is not None:
|
||||
break
|
||||
|
||||
real_tool_calls = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user