Messages#

Choose message roles and distinguish model input from stored history.

Read the walkthrough before consulting individual signatures.

Public interfaces#

Interface

Purpose

AgentMessage

Internal extension input, persisted as agent and sent as user to providers.

AssistantMessage

Model text, reasoning, and complete tool calls.

ImageBytesSource

In-memory encoded image bytes and their MIME type.

ImageContent

One image block in an ordered multimodal message.

ImageDetail

Provider-neutral image fidelity requested from a vision-capable model.

ImageUrlSource

Remote or data URL containing an image.

Message

Common base for user, internal agent, assistant, system, and tool roles.

MessageRole

Roles understood by the provider-neutral agent protocol.

SystemMessage

Application instructions placed before conversational messages.

TextContent

One text block in an ordered multimodal message.

ToolCall

A complete model request to invoke a named tool.

ToolMessage

One tool result returned to the model.

UserMessage

User text or ordered text/image blocks.