mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-11 21:30:59 +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:
|
async for chunk in resp_gen:
|
||||||
# print(chunk)
|
# 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
|
continue
|
||||||
|
|
||||||
if chunk.choices[0].delta.content is not None:
|
if chunk.choices[0].delta.content is not None:
|
||||||
@@ -75,6 +75,9 @@ class OpenAIChatCompletions(requester.LLMAPIRequester):
|
|||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
tool_calls.append(tool_call)
|
tool_calls.append(tool_call)
|
||||||
|
|
||||||
|
if chunk.choices[0].finish_reason is not None:
|
||||||
|
break
|
||||||
|
|
||||||
real_tool_calls = []
|
real_tool_calls = []
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user