pub struct ContextInput {
pub user_message: Option<String>,
pub session_id: Option<String>,
pub metadata: Value,
}Expand description
Input provided to context adapters.
Fields§
§user_message: Option<String>Optional user message to include.
session_id: Option<String>Optional session identifier.
metadata: ValueApplication-specific metadata.
Implementations§
Source§impl ContextInput
impl ContextInput
Sourcepub fn with_user_message(self, message: impl Into<String>) -> Self
pub fn with_user_message(self, message: impl Into<String>) -> Self
Sets the user message.
Sourcepub fn with_session_id(self, session_id: impl Into<String>) -> Self
pub fn with_session_id(self, session_id: impl Into<String>) -> Self
Sets the session identifier.
Sourcepub fn with_metadata(self, metadata: Value) -> Self
pub fn with_metadata(self, metadata: Value) -> Self
Sets application metadata.
Trait Implementations§
Source§impl Clone for ContextInput
impl Clone for ContextInput
Source§fn clone(&self) -> ContextInput
fn clone(&self) -> ContextInput
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ContextInput
impl Debug for ContextInput
Source§impl Default for ContextInput
impl Default for ContextInput
Source§fn default() -> ContextInput
fn default() -> ContextInput
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ContextInput
impl<'de> Deserialize<'de> for ContextInput
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ContextInput
impl RefUnwindSafe for ContextInput
impl Send for ContextInput
impl Sync for ContextInput
impl Unpin for ContextInput
impl UnsafeUnpin for ContextInput
impl UnwindSafe for ContextInput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more