SessionMessage
Defined in the session module.Rust AI Agent SDK A single message in a session
Fields
| Name | Type | Description |
|---|---|---|
role | "user" | - |
role | String | Message role: “user”, “assistant”, “system” |
content | String | Message content |
timestamp | f64 | Unix timestamp |
metadata | HashMap<String | Optional metadata |
serde_json | :Value> | Optional metadata |
Methods
new
| Name | Type |
|---|---|
role | impl Into<String> |
content | impl Into<String> |
user
| Name | Type |
|---|---|
content | impl Into<String> |
assistant
| Name | Type |
|---|---|
content | impl Into<String> |
system
| Name | Type |
|---|---|
content | impl Into<String> |
with_metadata
| Name | Type |
|---|---|
key | impl Into<String> |
value | serde_json::Value |
to_message
Source
View on GitHub
praisonai/src/session/mod.rs at line 51
