Skip to content

Message models

seqoria_agent.models.chunk

Streaming chunk value object - used by :pymeth:seqoria_agent.AIClient.stream_chat.

AssistantMessage

Bases: BaseModel

Complete assistant response with optional reasoning and token usage.

ChatChunk

Bases: BaseModel

Incremental piece of a streamed chat response.

LLMUsage

Bases: BaseModel

Usage information for an LLM call.

SystemMessage

Bases: BaseModel

System instructions included in conversation history.

ToolCallError

Bases: BaseModel

Represents a failed tool execution.

Errors use an explicit error payload and tool_error role/type. Inspect the message type before reading a success result or error.

ToolCallRequest

Bases: BaseModel

A model request to execute a named tool.

Attributes:

Name Type Description
id str

The ID of the tool call.

type Literal['function_call']

The type of the tool call.

name str

The name of the tool call.

arguments dict

The arguments of the tool call.

ToolCallRequestList

Bases: BaseModel

A batch of model-requested tool calls with optional usage.

ToolCallResult

Bases: BaseModel

A successful tool execution result, paired with its request by call ID.

Attributes:

Name Type Description
tool_call_id str

The ID of the tool call.

name Optional[str]

The name of the tool.

result str

The result of the tool call.

type Literal['tool_use']

The type of the message.

ToolMessages

Bases: list

Validated list of tool requests, results, and errors.

Iterables are materialized once so generators work for construction and updates. Batch updates validate before changing the list.

__add__(other: list[Any]) -> list[Any]

Preserve ordinary list concatenation without mutating this group.

UserMessage

Bases: BaseModel

User turn: plain text or OpenAI-style multimodal content blocks (text, image, audio).

Providers that support multimodal input (e.g. Ollama) receive content as-is in chat history; others may only use the text parts.

seqoria_agent.models.errors

Error types for tool execution and client orchestration.

CircuitOpenError

Bases: Exception

Raised when a circuit breaker is open for a given server and tool calls are blocked.

DependencyError

Bases: Exception

Raised when a circular or otherwise invalid dependency graph is detected.

The :class:AIClient raises this error as soon as it notices that the dependency requirements expressed via the depends_on annotation cannot be satisfied (e.g. because of a cycle like A → B → A).

ToolRemoteError

Bases: Exception

Wraps exceptions raised during remote tool execution.