Skip to content

Types Module

types

Type definitions for the OpenAI Toolchain.

ToolCall

Bases: TypedDict

A tool call made by the model.

Source code in openai_toolchain/types.py
class ToolCall(TypedDict):
    """A tool call made by the model."""

    id: str
    type: Literal["function"]
    function: ToolFunction

ToolFunction

Bases: TypedDict

A function that can be called by the model.

Source code in openai_toolchain/types.py
class ToolFunction(TypedDict):
    """A function that can be called by the model."""

    name: str
    arguments: str

ToolResult

Bases: TypedDict

The result of a tool call.

Source code in openai_toolchain/types.py
class ToolResult(TypedDict):
    """The result of a tool call."""

    tool_call_id: str
    name: str
    content: str