mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-27 16:04:21 +00:00
fix(agent-runner): stabilize event context and streams
This commit is contained in:
committed by
huanghuoguoguo
parent
9bdebcdc5a
commit
a2b38f5bf2
@@ -359,7 +359,8 @@ class OpenAIChatCompletions(requester.ProviderAPIRequester):
|
||||
|
||||
if hasattr(chunk, 'choices') and chunk.choices:
|
||||
choice = chunk.choices[0]
|
||||
delta = choice.delta.model_dump() if hasattr(choice, 'delta') else {}
|
||||
delta_obj = getattr(choice, 'delta', None)
|
||||
delta = delta_obj.model_dump() if delta_obj is not None else {}
|
||||
|
||||
finish_reason = getattr(choice, 'finish_reason', None)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user