Skip to content

Messages ​

Messages are Anvia's provider-neutral transcript format. Completions, agents, memory, tools, and UI adapters share the same role and content contracts.

Explore messages ​

PageLearn how to
Message rolesUse system, user, assistant, and tool messages correctly.
Content typesBuild text, image, document, reasoning, and tool content.
DocumentsAttach small documents to messages and completion requests.
Tool callPreserve the complete tool exchange in history.
ReasoningHandle operational model content and generation details safely.
TranscriptsStore and continue complete conversations.

The message shape ​

ts
import { Message } from '@anvia/core'

const messages = [
  Message.system('Answer clearly and concisely.'),
  Message.user('Summarize this incident.'),
]

Use the factory helpers to create valid content arrays and metadata. Provider adapters translate these normalized messages into their native API formats.

Check the selected completion model before sending images, documents, tools, reasoning, or other optional content.

Built for Anvia.