Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
SessionData
Defined in the session module.
Rust AI Agent SDK
Complete session data structure
Fields
| Name | Type | Description |
|---|
session_id | String | Session ID |
messages | Vec<SessionMessage> | Messages in the session |
created_at | String | Creation timestamp (ISO 8601) |
updated_at | String | Last update timestamp (ISO 8601) |
agent_name | Option<String> | Agent name (optional) |
user_id | Option<String> | User ID (optional) |
metadata | HashMap<String | Additional metadata |
serde_json | :Value> | Additional metadata |
Methods
new
fn new(session_id: impl Into<String>) -> Self
Create new session data
Parameters:
| Name | Type |
|---|
session_id | impl Into<String> |
get_chat_history
fn get_chat_history(&self, max_messages: Option<usize>) -> Vec<Message>
Get chat history in LLM-compatible format
Parameters:
| Name | Type |
|---|
max_messages | Option<usize> |
add_message
fn add_message(&mut self, message: SessionMessage) -> ()
Add a message
Parameters:
| Name | Type |
|---|
message | SessionMessage |
clear
fn clear(&mut self) -> ()
Clear all messages
Source
View on GitHub
praisonai/src/session/mod.rs at line 113