Module tool

Source
Expand description

§Tool Calling Module

This module defines the data types required for tool calling functionality. It includes types for representing function descriptions, callable tools, tool calls returned in API responses, and tool selection options.

§Overview

  • FunctionDescription: Describes a callable function with a name, optional description, and a JSON Schema for its parameters.
  • Tool: An enum representing available types of tools. Currently, only function‑type tools are supported.
  • FunctionCall: Represents the details of a requested tool call including the function name and JSON‑encoded arguments.
  • ToolCall: Captures the tool call details as returned by the API, including a unique identifier and the associated function call details.
  • ToolChoice: Represents the possible outcomes when the model must select a tool (for example, “none”, “auto”, or a specific function choice).
  • FunctionName: A simple structure to represent a function name for tool selection.

Structs§

FunctionCall
Represents the specific function call requested by the model.
FunctionDescription
Represents a description for a callable function (tool).
FunctionName
A simple struct to represent a function name for tool selection.
ToolCall
Represents the tool call details returned by the API.

Enums§

Tool
Encapsulates a tool that the model can call.
ToolChoice
Represents a tool selection option when the model must choose among available tools.