mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-28 07:31:59 +00:00
Fixes for multi-turn tool calls in Responses API
Testing with Codex locally, I found another issue in how we were plumbing through tool calls in multi-turn scenarios and the way tool call inputs and outputs from previous turns were passed back into future turns. This led me to realize we were missing the function tool call output type in the Responses API, so this adds that and plumbs handling of it through the responses API to chat completion conversion code. Signed-off-by: Ben Browning <bbrownin@redhat.com>
This commit is contained in:
parent
65c56d0ee8
commit
4df8caab41
4 changed files with 187 additions and 69 deletions
106
docs/_static/llama-stack-spec.html
vendored
106
docs/_static/llama-stack-spec.html
vendored
|
|
@ -6471,11 +6471,47 @@
|
|||
{
|
||||
"$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/OpenAIResponseMessage"
|
||||
}
|
||||
]
|
||||
},
|
||||
"OpenAIResponseInputFunctionToolCallOutput": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"call_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"output": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"const": "function_call_output",
|
||||
"default": "function_call_output"
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"call_id",
|
||||
"output",
|
||||
"type"
|
||||
],
|
||||
"title": "OpenAIResponseInputFunctionToolCallOutput",
|
||||
"description": "This represents the output of a function call that gets passed back to the model."
|
||||
},
|
||||
"OpenAIResponseInputMessageContent": {
|
||||
"oneOf": [
|
||||
{
|
||||
|
|
@ -6764,6 +6800,41 @@
|
|||
],
|
||||
"title": "OpenAIResponseOutputMessageContentOutputText"
|
||||
},
|
||||
"OpenAIResponseOutputMessageFunctionToolCall": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"arguments": {
|
||||
"type": "string"
|
||||
},
|
||||
"call_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"const": "function_call",
|
||||
"default": "function_call"
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"arguments",
|
||||
"call_id",
|
||||
"name",
|
||||
"type",
|
||||
"id",
|
||||
"status"
|
||||
],
|
||||
"title": "OpenAIResponseOutputMessageFunctionToolCall"
|
||||
},
|
||||
"OpenAIResponseOutputMessageWebSearchToolCall": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
@ -6934,41 +7005,6 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"OpenAIResponseOutputMessageFunctionToolCall": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"arguments": {
|
||||
"type": "string"
|
||||
},
|
||||
"call_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"const": "function_call",
|
||||
"default": "function_call"
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"arguments",
|
||||
"call_id",
|
||||
"name",
|
||||
"type",
|
||||
"id",
|
||||
"status"
|
||||
],
|
||||
"title": "OpenAIResponseOutputMessageFunctionToolCall"
|
||||
},
|
||||
"OpenAIResponseObjectStream": {
|
||||
"oneOf": [
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue