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.
GatewayMessage
Defined in the gateway module.
Rust AI Agent SDK
A message sent through the gateway.
Fields
| Name | Type | Description |
|---|
content | serde_json::Value | Message content (text or structured data) |
sender_id | String | Sender identifier |
session_id | String | Session this message belongs to |
message_id | String | Unique message identifier |
timestamp | f64 | Message creation time (Unix timestamp) |
metadata | HashMap<String | Additional message metadata |
serde_json | :Value> | Additional message metadata |
reply_to | Option<String> | ID of message being replied to (optional) |
Methods
new
fn new(
content: impl Into<serde_json::Value>,
sender_id: impl Into<String>,
session_id: impl Into<String>,
) -> Self
Create a new gateway message.
Parameters:
| Name | Type |
|---|
content | impl Into<serde_json::Value> |
sender_id | impl Into<String> |
session_id | impl Into<String> |
text
fn text(
text: impl Into<String>,
sender_id: impl Into<String>,
session_id: impl Into<String>,
) -> Self
Create a text message.
Parameters:
| Name | Type |
|---|
text | impl Into<String> |
sender_id | impl Into<String> |
session_id | impl Into<String> |
reply_to
fn reply_to(mut self, message_id: impl Into<String>) -> Self
Set reply_to message ID.
Parameters:
| Name | Type |
|---|
message_id | impl Into<String> |
fn metadata(mut self, key: impl Into<String>, value: serde_json::Value) -> Self
Add metadata.
Parameters:
| Name | Type |
|---|
key | impl Into<String> |
value | serde_json::Value |
text_content
fn text_content(&self) -> Option<&str>
Get text content if available.
Source
View on GitHub
praisonai/src/gateway/mod.rs at line 190