Skip to content
View as Markdown

tinker_cookbook.tool_use.ToolSpec

Generated from tinker-cookbook at commit 4a3a282. Source links point at that snapshot.

class tinker_cookbook.tool_use.ToolSpec(TypedDict)

Tool specification following the OpenAI function calling format.

This represents a tool that can be called by the model, including its name, description, and parameter schema.

tool_spec: ToolSpec = {
"name": "get_weather",
"description": "Get the current weather for a location",
"parameters": {
"type": "object",
"properties": {
"location": {"type": "string", "description": "City name"},
},
"required": ["location"],
},
}

Fields:

  • name (str) – The name of the tool.
  • description (str) – A description of what the tool does.
  • parameters (dict) – JSON Schema object describing the tool's parameters.

Referenced by