-
Notifications
You must be signed in to change notification settings - Fork 1k
Python: Add tool call/result content types and update connectors and samples #2971
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
eavanvalkenburg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good so far, there are also samples with image generation and code, can you update those as well @copilot
python/packages/core/agent_framework/openai/_responses_client.py
Outdated
Show resolved
Hide resolved
python/packages/core/agent_framework/openai/_responses_client.py
Outdated
Show resolved
Hide resolved
Updated the OpenAI image generation and code interpreter samples to use the new tool call/result content shapes and proper tool lists (1079faa). Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some additional comments, and the McpServer contents also need handling, also those names should be MCP instead of Mcp (python standard vs dotnet standard) @copilot
python/packages/core/agent_framework/openai/_responses_client.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couple of notes, and OpenAI Assistants also supports Code Interpreter, so that needs handling. Anthropic also support HostedMCPTool and Code interpreter, so those types need handling as well. @copilot
python/packages/core/agent_framework/openai/_responses_client.py
Outdated
Show resolved
Hide resolved
Updated MCP content naming, parsing, and connector handling; also added option translation for image generation tools as requested (3866935).
Added code interpreter and MCP handling across Responses, Assistants, and Anthropic connectors to emit the new content types (3866935). |
|
@copilot FunctionApprovalRequestContent also needs to allow MCPServerToolCallContent as the function_call inside of it. |
|
@copilot python/packages/core/agent_framework/openai/_responses_client.py:348 is not needed, folks should use the Tool type |
|
There are also these samples that use the raw dictionary: |
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com>
…tool support Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com>
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com>
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com>
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com>
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com>
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com>
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com>
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com>
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com>
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com>
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com>
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com>
7bae918 to
aa92e9b
Compare
|
Thanks @giles17 fixed |
Motivation and Context
MEAI introduced new content types for tool calls/results (code interpreter, MCP server, image generation) and enhancements to hosted file metadata; Python core needed parity so connectors can emit/consume these shapes.
Description
CodeInterpreterToolCallContent,CodeInterpreterToolResultContent,ImageGenerationToolCallContent,ImageGenerationToolResultContent,MCPServerToolCallContent,MCPServerToolResultContent; extendedHostedFileContentwith optionalmedia_typeandname; updatedContentsunion and serialization.FunctionApprovalRequestContentnow acceptsMCPServerToolCallContentin addition to standard function calls.HostedImageGenerationToolwith typed options/additional properties and translate those options to OpenAI Responses parameters.FunctionCallContentfor non-code-execution tools, fixed missingChatResponse/CitationAnnotationimports and code-block handling to satisfy type checks, and ensured MCP parsing/typing is consistent.agentlightningis not installed.Example:
Contribution Checklist
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.