Repository navigation
[Feature]: use native multimodal function_call_output in OpenAI Responses formatter #2369
Replies: 2 comments
|
@fancyboi999 Thanks for pointing out this issue. @qbc2016 Plz take a look at this? |
|
@fancyboi999 Thanks for the detailed investigation. I agree that The formatter should represent the official protocol accurately. Provider-specific differences in OpenAI-compatible endpoints should be handled separately and should not determine the behavior of the core OpenAI formatter. Please proceed with the following behavior:
I do not think a compatibility flag is necessary in |
Uh oh!
There was an error while loading. Please reload this page.
Background
The current OpenAI Responses API accepts either a string or an array of text, image, and file content items in
function_call_output.output. See the official function-calling guide.AgentScope's
OpenAIResponseFormattercurrently takes a multimodalToolResultBlockthroughconvert_tool_result_to_string()instead:function_call_outputcontaining a system reminder;DataBlockvalues into a separate syntheticusermessage.The behavior is pinned in
tests/formatter_openai_response_test.pyand was introduced as part of #1621, when multimodal promotion was used as a provider-compatible fallback.Why consider the native form
For the Responses API specifically, using the native output array would:
call_id;function_call_output.output.A live AgentScope probe against an OpenAI-compatible Responses endpoint completed a full tool-call → Base64 PNG tool result → second model call flow with the current promotion path, so the existing implementation is functional. This proposal is about preserving native protocol semantics, not fixing a broken tool loop.
Proposed behavior
For
OpenAIResponseFormatteronly:DataBlockvalues directly asinput_image/input_fileitems in thefunction_call_output.outputarray;Suggested verification:
Related, not duplicate
ToolResultDataDeltaEventcontains exactly one ofdataorurl; it is independent of formatter serialization.I would like maintainer feedback on the compatibility policy before implementing this, especially whether native arrays should be the default for
OpenAIResponseFormatteror gated for OpenAI-compatible endpoints.All reactions