镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Send gen_ai.tool.definitions with appropriate format #7973

Open
0 of 3 issues completed
Open

Description

As per the GenAI RFC:

Tool definitions are represented as a JSON array with objects whose "name", "description" and "type" properties correspond to the attributes on Execute Tool Spans. The objects also have a "parameters" property, whose format is given by JSON Schema draft-07.

Each tool definition has a name, a type, optionally parameters, and an optional description:

[
    {
        "name": "get_weather",
        "description": "Get the current weather for a given location.",
        "type": "function",
        "parameters": {
            "type": "object",
            "properties": {
                "productId": {
                    "description": "The unique identifier for a product",
                    "type": "integer"
                },
                "productName": {
                    "description": "Name of the product",
                    "type": "string"
                },
                "price": {
                    "description": "The price of the product",
                    "type": "number",
                    "exclusiveMinimum": 0
                },
                "tags": {
                    "description": "Tags for the product",
                    "type": "array",
                    "items": {
                        "type": "string"
                    },
                    "minItems": 1,
                    "uniqueItems": true
                },
                "dimensions": {
                    "type": "object",
                    "properties": {
                        "length": { "type": "number" },
                        "width": { "type": "number" },
                        "height": { "type": "number" }
                    },
                    "required": ["length", "width", "height"]
                }
            },
            "required": ["productId", "productName", "price"]
        }
    },
    ...
]

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions