Message • Rust AI Agent SDK
Message: A message in a conversation
Message
Defined in the LLM module.
Rust AI Agent SDK
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<String> | Tool call ID (for tool responses) |
Option | :is_none")] | Tool calls made by the assistant |
tool_calls | Option<Vec<ToolCall>> | Tool calls made by the assistant |
Methods
system
fn system(content: impl Into<String>) -> SelfCreate a system message
Parameters:
| Name | Type |
|---|---|
content | impl Into<String> |
user
fn user(content: impl Into<String>) -> SelfCreate a user message
Parameters:
| Name | Type |
|---|---|
content | impl Into<String> |
assistant
fn assistant(content: impl Into<String>) -> SelfCreate an assistant message
Parameters:
| Name | Type |
|---|---|
content | impl Into<String> |
tool
fn tool(tool_call_id: impl Into<String>, content: impl Into<String>) -> SelfCreate a tool response message
Parameters:
| Name | Type |
|---|---|
tool_call_id | impl Into<String> |
content | impl Into<String> |
Source
View on GitHubpraisonai/src/llm/mod.rs at line 39