-
Notifications
You must be signed in to change notification settings - Fork 291
Built-in Tools Support #3038
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
Open
singankit
wants to merge
5
commits into
open-telemetry:main
Choose a base branch
from
singankit:users/singankit/server-side-tool-calls
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Built-in Tools Support #3038
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3362eee
Sample for responses API with code interpreter tool
singankit 76ddd58
Extendable Schema for tool call
singankit 917b650
Updating samples and ToolCallResponsePart schema to be polymorphic
singankit 23434e2
Adding changelog file
singankit 30ce89b
Updating changelog
singankit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Use this changelog template to create an entry for release notes. | ||
| # | ||
| # If your change doesn't affect end users you should instead start | ||
| # your pull request title with [chore] or use the "Skip Changelog" label. | ||
|
|
||
| # One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
| change_type: enhancement | ||
|
|
||
| # The name of the area of concern in the attributes-registry, (e.g. http, cloud, db) | ||
| component: gen-ai | ||
|
|
||
| # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
| note: | | ||
| Enhance how tool calls are captured to extend support for server side tools. | ||
|
|
||
| # Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. | ||
| # The values here must be integers. | ||
| issues: [2585] | ||
|
|
||
| # (Optional) One or more lines of additional information to render under the primary note. | ||
| # These lines will be padded with 2 spaces and then inserted directly into the document. | ||
| # Use pipe (|) for multiline entries. | ||
| subtext: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -118,6 +118,118 @@ | |
| "title": "ChatMessage", | ||
| "type": "object" | ||
| }, | ||
| "CodeInterpreterToolCall": { | ||
| "additionalProperties": false, | ||
| "description": "Code interpreter tool call.", | ||
| "properties": { | ||
| "type": { | ||
| "const": "code_interpreter", | ||
| "description": "Type identifier for code interpreter calls.", | ||
| "title": "Type", | ||
| "type": "string" | ||
| }, | ||
| "code": { | ||
| "description": "The Python code to execute.", | ||
| "title": "Code", | ||
| "type": "string" | ||
| }, | ||
| "container_id": { | ||
| "anyOf": [ | ||
| { | ||
| "type": "string" | ||
| }, | ||
| { | ||
| "type": "null" | ||
| } | ||
| ], | ||
| "default": null, | ||
| "description": "Container identifier for code execution environment.", | ||
| "title": "Container Id" | ||
| } | ||
| }, | ||
| "required": ["type", "code"], | ||
| "title": "CodeInterpreterToolCall", | ||
| "type": "object" | ||
| }, | ||
| "CodeInterpreterToolCallResponse": { | ||
| "additionalProperties": false, | ||
| "description": "Code interpreter tool call response.", | ||
| "properties": { | ||
| "type": { | ||
| "const": "code_interpreter", | ||
| "description": "Type identifier for code interpreter responses.", | ||
| "title": "Type", | ||
| "type": "string" | ||
| }, | ||
| "outputs": { | ||
| "description": "Array of outputs from code execution.", | ||
| "items": { | ||
| "oneOf": [ | ||
| { | ||
| "description": "Logs output from code execution.", | ||
| "properties": { | ||
| "type": { | ||
| "const": "logs", | ||
| "description": "Output type identifier.", | ||
| "title": "Type", | ||
| "type": "string" | ||
| }, | ||
| "logs": { | ||
| "description": "Text output from code execution.", | ||
| "title": "Logs", | ||
| "type": "string" | ||
| } | ||
| }, | ||
| "required": ["type", "logs"], | ||
| "title": "LogsOutput", | ||
| "type": "object", | ||
| "additionalProperties": false | ||
| }, | ||
| { | ||
| "description": "Image output from code execution.", | ||
| "properties": { | ||
| "type": { | ||
| "const": "image", | ||
| "description": "Output type identifier.", | ||
| "title": "Type", | ||
| "type": "string" | ||
| }, | ||
| "image": { | ||
| "description": "Image data from code execution.", | ||
| "properties": { | ||
| "file_id": { | ||
| "anyOf": [ | ||
| { | ||
| "type": "string" | ||
| }, | ||
| { | ||
| "type": "null" | ||
| } | ||
| ], | ||
| "default": null, | ||
| "description": "File identifier for the generated image.", | ||
| "title": "File Id" | ||
| } | ||
| }, | ||
| "title": "Image", | ||
| "type": "object" | ||
| } | ||
| }, | ||
| "required": ["type", "image"], | ||
| "title": "ImageOutput", | ||
| "type": "object", | ||
| "additionalProperties": false | ||
| } | ||
| ] | ||
| }, | ||
| "title": "Outputs", | ||
| "type": "array" | ||
| } | ||
| }, | ||
| "required": ["type", "outputs"], | ||
| "title": "CodeInterpreterToolCallResponse", | ||
| "type": "object" | ||
| }, | ||
| "FilePart": { | ||
| "additionalProperties": true, | ||
| "description": "Represents an external referenced file sent to the model by file id", | ||
|
|
@@ -167,6 +279,50 @@ | |
| "title": "FilePart", | ||
| "type": "object" | ||
| }, | ||
| "FunctionToolCall": { | ||
| "additionalProperties": false, | ||
| "description": "Function tool call.", | ||
| "properties": { | ||
| "type": { | ||
| "const": "function", | ||
| "description": "Type identifier for function calls.", | ||
| "title": "Type", | ||
| "type": "string" | ||
| }, | ||
| "name": { | ||
| "description": "Name of the function.", | ||
| "title": "Name", | ||
| "type": "string" | ||
| }, | ||
| "arguments": { | ||
| "default": null, | ||
| "description": "Arguments for the function call.", | ||
| "title": "Arguments" | ||
| } | ||
| }, | ||
| "required": ["type", "name"], | ||
| "title": "FunctionToolCall", | ||
| "type": "object" | ||
| }, | ||
| "FunctionToolCallResponse": { | ||
| "additionalProperties": false, | ||
| "description": "Function tool call response.", | ||
| "properties": { | ||
| "type": { | ||
| "const": "function", | ||
| "description": "Type identifier for function responses.", | ||
| "title": "Type", | ||
| "type": "string" | ||
| }, | ||
| "content": { | ||
| "description": "The response content from the function call.", | ||
| "title": "Content" | ||
| } | ||
| }, | ||
| "required": ["type", "content"], | ||
| "title": "FunctionToolCallResponse", | ||
| "type": "object" | ||
| }, | ||
| "GenericPart": { | ||
| "additionalProperties": true, | ||
| "description": "Represents an arbitrary message part with any type and properties.\nThis allows for extensibility with custom message part types.", | ||
|
|
@@ -276,15 +432,23 @@ | |
| "title": "Name", | ||
| "type": "string" | ||
| }, | ||
| "arguments": { | ||
| "default": null, | ||
| "description": "Arguments for the tool call.", | ||
| "title": "Arguments" | ||
| "tool_call": { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you think of flattening the changes into a new part type instead of extending the |
||
| "description": "Polymorphic tool call details with type discriminator.", | ||
| "oneOf": [ | ||
| { | ||
| "$ref": "#/$defs/FunctionToolCall" | ||
| }, | ||
| { | ||
| "$ref": "#/$defs/CodeInterpreterToolCall" | ||
| } | ||
| ], | ||
| "title": "Tool Call" | ||
| } | ||
| }, | ||
| "required": [ | ||
| "type", | ||
| "name" | ||
| "name", | ||
| "tool_call" | ||
| ], | ||
| "title": "ToolCallRequestPart", | ||
| "type": "object" | ||
|
|
@@ -313,7 +477,15 @@ | |
| "title": "Id" | ||
| }, | ||
| "response": { | ||
| "description": "Tool call response.", | ||
| "description": "Polymorphic tool call response with type discriminator.", | ||
| "oneOf": [ | ||
| { | ||
| "$ref": "#/$defs/FunctionToolCallResponse" | ||
| }, | ||
| { | ||
| "$ref": "#/$defs/CodeInterpreterToolCallResponse" | ||
| } | ||
| ], | ||
| "title": "Response" | ||
| } | ||
| }, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
let's also update the python code