Skip to main content

Module types

Module types 

Source
Expand description

Core type system for the LLM abstraction layer.

Mirrors @earendil-works/pi-ai types: messages, content blocks, usage, models, and tool schemas. These types are the boundary between the agent loop and the provider implementations.

Structs§

AssistantMessage
A message produced by the model.
Cost
Model
A resolved model definition used to drive provider requests.
ToolResultMessage
A tool-result message fed back to the model.
ToolSchema
The schema fragment sent to the model describing an available tool.
Usage
UserMessage
A user-authored message.

Enums§

Api
Which wire protocol a model speaks. Beta targets only the Anthropic Messages API.
ContentBlock
A single block within an assistant message. Mirrors pi’s TextContent | ThinkingContent | ToolCall.
Message
The union of messages that make up a transcript.
StopReason
Why the assistant stopped generating.
ThinkingLevel
Reasoning/thinking level for models that support it.
ToolResultContent
Content returned from a tool execution. Mirrors the tool-result content.
UserBlock
A block within a user message. Mirrors TextContent | ImageContent.