#[non_exhaustive]pub struct MessageContext {
pub ai_role: Option<String>,
pub ai_role_id: Option<i64>,
pub application: Option<Box<Application>>,
pub completion_tokens: Option<i64>,
pub name: Option<String>,
pub prompt_tokens: Option<i64>,
pub service: Option<Box<Service>>,
pub total_tokens: Option<i64>,
pub uid: Option<String>,
}Expand description
Message Context
Communication context for AI system interactions including protocols, roles, clients, and session information for MCP and other AI communication systems.
[] Category: | Name: message_context
Constraints:
- at_least_one:
[name,uid]
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.ai_role: Option<String>AI Role
The normalized caption of the ai_role_id.
optional
ai_role_id: Option<i64>AI Role ID
Specifies the functional role of the AI within the context of this message, such as retrieving information, assisting reasoning, executing a tool, or generating content.
recommended
application: Option<Box<Application>>Application
The initiating client application. In AI systems, this represents the client-side application or framework that initiates requests (e.g., LangChain application, web browser, mobile app, SDK implementation).
recommended
completion_tokens: Option<i64>Completion Tokens
Number of tokens in the model’s response/completion for this message.
optional
name: Option<String>Name
The name or identifier of the message context. In AI systems, this could be the conversation ID, session name, thread identifier, or interaction name (e.g., ‘user-session-123’, ‘conversation-abc’, ‘chat-thread-456’).
recommended
prompt_tokens: Option<i64>Prompt Tokens
Number of tokens in the input prompt for this message.
optional
service: Option<Box<Service>>Service
The server or service handling the request. In AI systems, this represents the AI service, API endpoint, or agent that processes and responds to requests (e.g., OpenAI API service, Claude API service, internal AI model service).
recommended
total_tokens: Option<i64>Total Tokens
Total number of tokens used for this message (prompt + completion).
optional
uid: Option<String>Unique ID
The unique identifier of the message context. This could be a session ID, conversation ID, or other unique identifier that allows correlation of messages within the same context.
recommended
Trait Implementations§
Source§impl Clone for MessageContext
impl Clone for MessageContext
Source§fn clone(&self) -> MessageContext
fn clone(&self) -> MessageContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more