mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-07 18:57:21 +00:00
feat(tools): use { input_schema, output_schema } for ToolDefinition
This commit is contained in:
parent
42414a1a1b
commit
139320e19f
20 changed files with 1989 additions and 386 deletions
179
docs/static/llama-stack-spec.html
vendored
179
docs/static/llama-stack-spec.html
vendored
|
|
@ -7383,12 +7383,57 @@
|
|||
"type": "string",
|
||||
"description": "(Optional) Human-readable description of what the tool does"
|
||||
},
|
||||
"parameters": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/ToolParameter"
|
||||
"input_schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "null"
|
||||
},
|
||||
{
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "array"
|
||||
},
|
||||
{
|
||||
"type": "object"
|
||||
}
|
||||
]
|
||||
},
|
||||
"description": "(Optional) List of parameters this tool accepts"
|
||||
"description": "(Optional) JSON Schema for tool inputs (MCP inputSchema)"
|
||||
},
|
||||
"output_schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "null"
|
||||
},
|
||||
{
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "array"
|
||||
},
|
||||
{
|
||||
"type": "object"
|
||||
}
|
||||
]
|
||||
},
|
||||
"description": "(Optional) JSON Schema for tool outputs (MCP outputSchema)"
|
||||
},
|
||||
"metadata": {
|
||||
"type": "object",
|
||||
|
|
@ -7424,68 +7469,6 @@
|
|||
"title": "ToolDef",
|
||||
"description": "Tool definition used in runtime contexts."
|
||||
},
|
||||
"ToolParameter": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "Name of the parameter"
|
||||
},
|
||||
"parameter_type": {
|
||||
"type": "string",
|
||||
"description": "Type of the parameter (e.g., string, integer)"
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"description": "Human-readable description of what the parameter does"
|
||||
},
|
||||
"required": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Whether this parameter is required for tool invocation"
|
||||
},
|
||||
"items": {
|
||||
"type": "object",
|
||||
"description": "Type of the elements when parameter_type is array"
|
||||
},
|
||||
"title": {
|
||||
"type": "string",
|
||||
"description": "(Optional) Title of the parameter"
|
||||
},
|
||||
"default": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "null"
|
||||
},
|
||||
{
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "array"
|
||||
},
|
||||
{
|
||||
"type": "object"
|
||||
}
|
||||
],
|
||||
"description": "(Optional) Default value for the parameter if not provided"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"name",
|
||||
"parameter_type",
|
||||
"description",
|
||||
"required"
|
||||
],
|
||||
"title": "ToolParameter",
|
||||
"description": "Parameter definition for a tool."
|
||||
},
|
||||
"TopKSamplingStrategy": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
@ -13132,6 +13115,68 @@
|
|||
"title": "Tool",
|
||||
"description": "A tool that can be invoked by agents."
|
||||
},
|
||||
"ToolParameter": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "Name of the parameter"
|
||||
},
|
||||
"parameter_type": {
|
||||
"type": "string",
|
||||
"description": "Type of the parameter (e.g., string, integer)"
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"description": "Human-readable description of what the parameter does"
|
||||
},
|
||||
"required": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Whether this parameter is required for tool invocation"
|
||||
},
|
||||
"items": {
|
||||
"type": "object",
|
||||
"description": "Type of the elements when parameter_type is array"
|
||||
},
|
||||
"title": {
|
||||
"type": "string",
|
||||
"description": "(Optional) Title of the parameter"
|
||||
},
|
||||
"default": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "null"
|
||||
},
|
||||
{
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "array"
|
||||
},
|
||||
{
|
||||
"type": "object"
|
||||
}
|
||||
],
|
||||
"description": "(Optional) Default value for the parameter if not provided"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"name",
|
||||
"parameter_type",
|
||||
"description",
|
||||
"required"
|
||||
],
|
||||
"title": "ToolParameter",
|
||||
"description": "Parameter definition for a tool."
|
||||
},
|
||||
"ToolGroup": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
|||
116
docs/static/llama-stack-spec.yaml
vendored
116
docs/static/llama-stack-spec.yaml
vendored
|
|
@ -5322,12 +5322,30 @@ components:
|
|||
type: string
|
||||
description: >-
|
||||
(Optional) Human-readable description of what the tool does
|
||||
parameters:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/ToolParameter'
|
||||
input_schema:
|
||||
type: object
|
||||
additionalProperties:
|
||||
oneOf:
|
||||
- type: 'null'
|
||||
- type: boolean
|
||||
- type: number
|
||||
- type: string
|
||||
- type: array
|
||||
- type: object
|
||||
description: >-
|
||||
(Optional) List of parameters this tool accepts
|
||||
(Optional) JSON Schema for tool inputs (MCP inputSchema)
|
||||
output_schema:
|
||||
type: object
|
||||
additionalProperties:
|
||||
oneOf:
|
||||
- type: 'null'
|
||||
- type: boolean
|
||||
- type: number
|
||||
- type: string
|
||||
- type: array
|
||||
- type: object
|
||||
description: >-
|
||||
(Optional) JSON Schema for tool outputs (MCP outputSchema)
|
||||
metadata:
|
||||
type: object
|
||||
additionalProperties:
|
||||
|
|
@ -5346,50 +5364,6 @@ components:
|
|||
title: ToolDef
|
||||
description: >-
|
||||
Tool definition used in runtime contexts.
|
||||
ToolParameter:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
description: Name of the parameter
|
||||
parameter_type:
|
||||
type: string
|
||||
description: >-
|
||||
Type of the parameter (e.g., string, integer)
|
||||
description:
|
||||
type: string
|
||||
description: >-
|
||||
Human-readable description of what the parameter does
|
||||
required:
|
||||
type: boolean
|
||||
default: true
|
||||
description: >-
|
||||
Whether this parameter is required for tool invocation
|
||||
items:
|
||||
type: object
|
||||
description: >-
|
||||
Type of the elements when parameter_type is array
|
||||
title:
|
||||
type: string
|
||||
description: (Optional) Title of the parameter
|
||||
default:
|
||||
oneOf:
|
||||
- type: 'null'
|
||||
- type: boolean
|
||||
- type: number
|
||||
- type: string
|
||||
- type: array
|
||||
- type: object
|
||||
description: >-
|
||||
(Optional) Default value for the parameter if not provided
|
||||
additionalProperties: false
|
||||
required:
|
||||
- name
|
||||
- parameter_type
|
||||
- description
|
||||
- required
|
||||
title: ToolParameter
|
||||
description: Parameter definition for a tool.
|
||||
TopKSamplingStrategy:
|
||||
type: object
|
||||
properties:
|
||||
|
|
@ -9667,6 +9641,50 @@ components:
|
|||
- parameters
|
||||
title: Tool
|
||||
description: A tool that can be invoked by agents.
|
||||
ToolParameter:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
description: Name of the parameter
|
||||
parameter_type:
|
||||
type: string
|
||||
description: >-
|
||||
Type of the parameter (e.g., string, integer)
|
||||
description:
|
||||
type: string
|
||||
description: >-
|
||||
Human-readable description of what the parameter does
|
||||
required:
|
||||
type: boolean
|
||||
default: true
|
||||
description: >-
|
||||
Whether this parameter is required for tool invocation
|
||||
items:
|
||||
type: object
|
||||
description: >-
|
||||
Type of the elements when parameter_type is array
|
||||
title:
|
||||
type: string
|
||||
description: (Optional) Title of the parameter
|
||||
default:
|
||||
oneOf:
|
||||
- type: 'null'
|
||||
- type: boolean
|
||||
- type: number
|
||||
- type: string
|
||||
- type: array
|
||||
- type: object
|
||||
description: >-
|
||||
(Optional) Default value for the parameter if not provided
|
||||
additionalProperties: false
|
||||
required:
|
||||
- name
|
||||
- parameter_type
|
||||
- description
|
||||
- required
|
||||
title: ToolParameter
|
||||
description: Parameter definition for a tool.
|
||||
ToolGroup:
|
||||
type: object
|
||||
properties:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue