mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-04 04:04:14 +00:00
feat: add support for require_approval argument when creating response (#3608)
# What does this PR do? This PR adds support for the require_approval on an mcp tool definition passed to create response in the Responses API. This allows the caller to indicate whether they want to approve calls to that server, or let them be called without approval. Closes #3443 ## Test Plan Tested both approval and denial. Added automated integration test for both cases. --------- Signed-off-by: Gordon Sim <gsim@redhat.com> Co-authored-by: Matthew Farrellee <matt@cs.wisc.edu>
This commit is contained in:
parent
0837fa7bef
commit
d350e3662b
8 changed files with 360 additions and 8 deletions
55
docs/static/llama-stack-spec.yaml
vendored
55
docs/static/llama-stack-spec.yaml
vendored
|
@ -6541,6 +6541,8 @@ components:
|
|||
- $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall'
|
||||
- $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall'
|
||||
- $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput'
|
||||
- $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest'
|
||||
- $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse'
|
||||
- $ref: '#/components/schemas/OpenAIResponseMessage'
|
||||
"OpenAIResponseInputFunctionToolCallOutput":
|
||||
type: object
|
||||
|
@ -6835,6 +6837,53 @@ components:
|
|||
title: OpenAIResponseInputToolWebSearch
|
||||
description: >-
|
||||
Web search tool configuration for OpenAI response inputs.
|
||||
OpenAIResponseMCPApprovalRequest:
|
||||
type: object
|
||||
properties:
|
||||
arguments:
|
||||
type: string
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
server_label:
|
||||
type: string
|
||||
type:
|
||||
type: string
|
||||
const: mcp_approval_request
|
||||
default: mcp_approval_request
|
||||
additionalProperties: false
|
||||
required:
|
||||
- arguments
|
||||
- id
|
||||
- name
|
||||
- server_label
|
||||
- type
|
||||
title: OpenAIResponseMCPApprovalRequest
|
||||
description: >-
|
||||
A request for human approval of a tool invocation.
|
||||
OpenAIResponseMCPApprovalResponse:
|
||||
type: object
|
||||
properties:
|
||||
approval_request_id:
|
||||
type: string
|
||||
approve:
|
||||
type: boolean
|
||||
type:
|
||||
type: string
|
||||
const: mcp_approval_response
|
||||
default: mcp_approval_response
|
||||
id:
|
||||
type: string
|
||||
reason:
|
||||
type: string
|
||||
additionalProperties: false
|
||||
required:
|
||||
- approval_request_id
|
||||
- approve
|
||||
- type
|
||||
title: OpenAIResponseMCPApprovalResponse
|
||||
description: A response to an MCP approval request.
|
||||
OpenAIResponseMessage:
|
||||
type: object
|
||||
properties:
|
||||
|
@ -7227,6 +7276,7 @@ components:
|
|||
- $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall'
|
||||
- $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall'
|
||||
- $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools'
|
||||
- $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest'
|
||||
discriminator:
|
||||
propertyName: type
|
||||
mapping:
|
||||
|
@ -7236,6 +7286,7 @@ components:
|
|||
function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall'
|
||||
mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall'
|
||||
mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools'
|
||||
mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest'
|
||||
OpenAIResponseOutputMessageMCPCall:
|
||||
type: object
|
||||
properties:
|
||||
|
@ -7785,6 +7836,7 @@ components:
|
|||
- $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall'
|
||||
- $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall'
|
||||
- $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools'
|
||||
- $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest'
|
||||
discriminator:
|
||||
propertyName: type
|
||||
mapping:
|
||||
|
@ -7794,6 +7846,7 @@ components:
|
|||
function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall'
|
||||
mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall'
|
||||
mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools'
|
||||
mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest'
|
||||
description: >-
|
||||
The output item that was added (message, tool call, etc.)
|
||||
output_index:
|
||||
|
@ -7836,6 +7889,7 @@ components:
|
|||
- $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall'
|
||||
- $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall'
|
||||
- $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools'
|
||||
- $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest'
|
||||
discriminator:
|
||||
propertyName: type
|
||||
mapping:
|
||||
|
@ -7845,6 +7899,7 @@ components:
|
|||
function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall'
|
||||
mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall'
|
||||
mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools'
|
||||
mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest'
|
||||
description: >-
|
||||
The completed output item (message, tool call, etc.)
|
||||
output_index:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue