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

# Message • Rust AI Agent SDK

> Message: A message in a conversation

# Message

> Defined in the [**LLM**](../modules/llm) module.

<Badge color="orange">Rust AI Agent SDK</Badge>

A message in a conversation

## Fields

| Name           | Type                                | Description                       |
| -------------- | ----------------------------------- | --------------------------------- |
| `role`         | `Role`                              | The role of the message sender    |
| `content`      | `String`                            | The content of the message        |
| `Option`       | `:is_none")]`                       | Tool call ID (for tool responses) |
| `tool_call_id` | `Option&lt;String&gt;`              | Tool call ID (for tool responses) |
| `Option`       | `:is_none")]`                       | Tool calls made by the assistant  |
| `tool_calls`   | `Option&lt;Vec&lt;ToolCall&gt;&gt;` | Tool calls made by the assistant  |

## Methods

### `system`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn system(content: impl Into<String>) -> Self
```

Create a system message

**Parameters:**

| Name      | Type                      |
| --------- | ------------------------- |
| `content` | `impl Into&lt;String&gt;` |

### `user`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn user(content: impl Into<String>) -> Self
```

Create a user message

**Parameters:**

| Name      | Type                      |
| --------- | ------------------------- |
| `content` | `impl Into&lt;String&gt;` |

### `assistant`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn assistant(content: impl Into<String>) -> Self
```

Create an assistant message

**Parameters:**

| Name      | Type                      |
| --------- | ------------------------- |
| `content` | `impl Into&lt;String&gt;` |

### `tool`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn tool(tool_call_id: impl Into<String>, content: impl Into<String>) -> Self
```

Create a tool response message

**Parameters:**

| Name           | Type                      |
| -------------- | ------------------------- |
| `tool_call_id` | `impl Into&lt;String&gt;` |
| `content`      | `impl Into&lt;String&gt;` |

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/llm/mod.rs#L39">
  `praisonai/src/llm/mod.rs` at line 39
</Card>
