pub struct DialogueContext {
pub session_id: String,
pub prompt: String,
pub turn_count: usize,
pub has_summary: bool,
}Expand description
A fully assembled prompt context combining episodic memory with the live dialogue history for a session.
Construct via DialogueContext::build and pass the resulting
DialogueContext::prompt string to an inference closure or LLM provider.
Fields§
§session_id: StringThe session ID this context was assembled for.
prompt: StringFinal assembled prompt string ready to be sent to an LLM.
turn_count: usizeNumber of dialogue turns included (after any summarization).
has_summary: boolWhether a summary of older turns is present in the prompt.
Implementations§
Source§impl DialogueContext
impl DialogueContext
Sourcepub fn build(session: &DialogueSession, episodic_context: Option<&str>) -> Self
pub fn build(session: &DialogueSession, episodic_context: Option<&str>) -> Self
Assemble a DialogueContext from a DialogueSession and an optional
episodic memory snippet.
The episodic_context string is typically produced by recalling items
from an crate::memory::EpisodicStore and formatting them as text.
Trait Implementations§
Source§impl Clone for DialogueContext
impl Clone for DialogueContext
Source§fn clone(&self) -> DialogueContext
fn clone(&self) -> DialogueContext
Returns a duplicate of the value. Read more
1.0.0 · 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 DialogueContext
impl Debug for DialogueContext
Source§impl<'de> Deserialize<'de> for DialogueContext
impl<'de> Deserialize<'de> for DialogueContext
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 DialogueContext
impl RefUnwindSafe for DialogueContext
impl Send for DialogueContext
impl Sync for DialogueContext
impl Unpin for DialogueContext
impl UnsafeUnpin for DialogueContext
impl UnwindSafe for DialogueContext
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