> ## Documentation Index
> Fetch the complete documentation index at: https://www.adaline.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Messages

# Messages

Message types used in chat completions.

## MessageType

Messages follow a role-based structure with multi-modal content support.

```typescript theme={null}
import { MessageType } from "@adaline/types";

const messages: MessageType[] = [
  {
    role: "system",
    content: [{ modality: "text", value: "You are a helpful assistant." }],
  },
  {
    role: "user",
    content: [
      { modality: "text", value: "What's in this image?" },
      { modality: "image", value: "https://example.com/image.png" },
    ],
  },
];
```

### Fields

<ParamField body="role" type="string" required>
  The message sender role. One of:

  * `"system"` — System instructions
  * `"user"` — User input
  * `"assistant"` — Model response
  * `"tool"` — Tool call result
</ParamField>

<ParamField body="content" type="ContentType[]" required>
  Array of content items. Each item has a `modality` and `value`.
</ParamField>

## ContentType

Content items represent different modalities within a message.

### Text Content

```typescript theme={null}
{ modality: "text", value: "Hello, world!" }
```

### Image Content

```typescript theme={null}
{ modality: "image", value: "https://example.com/image.png" }
// or base64
{ modality: "image", value: "data:image/png;base64,..." }
```

### Tool Call Content

Returned by the model when it wants to invoke a tool.

```typescript theme={null}
{
  modality: "tool_call",
  value: {
    id: "call_abc123",
    name: "get_weather",
    arguments: '{"location": "San Francisco"}',
  }
}
```

### Tool Result Content

Sent back to the model with the tool's response.

```typescript theme={null}
{
  modality: "tool_result",
  value: {
    id: "call_abc123",
    result: '{"temperature": 72, "condition": "sunny"}',
  }
}
```
