You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ChatCompletionCache should support messages that contain both tool_call and text (content) fields simultaneously. Currently, the implementation raises warnings and defaults to processing only tool_call, ignoring the content field. This is limiting and does not align with the behavior of certain models, such as gpt-4o, which can naturally return mixed messages.
/data/xxx/anaconda3/envs/apr/lib/python3.13/site-packages/autogen_ext/models/cache/_chat_completion_cache.py:132: UserWarning: Both tool_calls and content are present in the message. This is unexpected. content will be ignored, tool_calls will be used.
result = await self.client.create(
For example, a tool_call might include instructions to invoke a tool, and the content field could provide supplemental context or fallback output, both of which are important for downstream applications.
The desired feature should allow a single message to contain both tool_call and content fields without raising warnings or dropping data.
Why is this needed?
Models such as gpt-4o are designed to return mixed messages. Ignoring part of the response reduces the utility of these models and misaligns with their intended behavior.
The text was updated successfully, but these errors were encountered:
ekzhu
changed the title
Add Support for Mixed Messages Containing Both tool_call and Text in ChatCompletionCache
Add Support for Mixed Messages Containing Both tool_call and Text ChatCompletionClient
Jan 23, 2025
The warning comes from the openai client. Though the issue is more general, the CreateResult field current doesn't allow both text and tool call in the same result.
ekzhu
changed the title
Add Support for Mixed Messages Containing Both tool_call and Text ChatCompletionClient
Add Support for Mixed Messages Containing Both tool_call and Text from ChatCompletionClient
Jan 23, 2025
What feature would you like to be added?
The ChatCompletionCache should support messages that contain both tool_call and text (content) fields simultaneously. Currently, the implementation raises warnings and defaults to processing only tool_call, ignoring the content field. This is limiting and does not align with the behavior of certain models, such as gpt-4o, which can naturally return mixed messages.
For example, a tool_call might include instructions to invoke a tool, and the content field could provide supplemental context or fallback output, both of which are important for downstream applications.
The desired feature should allow a single message to contain both tool_call and content fields without raising warnings or dropping data.
Why is this needed?
Models such as gpt-4o are designed to return mixed messages. Ignoring part of the response reduces the utility of these models and misaligns with their intended behavior.
The text was updated successfully, but these errors were encountered: