mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
fix: preserve streaming structured output finalization
Agent-Logs-Url: https://github.com/microsoft/agent-framework/sessions/f62076ef-558d-49e8-8fe2-f38d527c9639 Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com>
This commit is contained in:
co-authored by
eavanvalkenburg
parent
cb8249ed95
commit
b07f055430
@@ -681,8 +681,13 @@ class RawOpenAIChatClient( # type: ignore[misc]
|
||||
except Exception as ex:
|
||||
self._handle_request_error(ex)
|
||||
|
||||
response_format = validated_options.get("response_format") if validated_options else None
|
||||
return self._build_response_stream(_stream(), response_format=response_format)
|
||||
return ResponseStream(
|
||||
_stream(),
|
||||
finalizer=lambda updates: self._finalize_response_updates(
|
||||
updates,
|
||||
response_format=validated_options.get("response_format") if validated_options else None,
|
||||
),
|
||||
)
|
||||
|
||||
# Non-streaming
|
||||
async def _get_response() -> ChatResponse:
|
||||
|
||||
Reference in New Issue
Block a user