pub struct MemoryConfig {
pub window: Option<WindowConfig>,
pub variable_selector: Option<Selector>,
pub query_prompt_template: Option<Template>,
}Expand description
Conversation memory.
History is read from variable_selector (default sys.history): an array of
{role, content} objects (or a JSON string encoding one), oldest first.
Roles are user/human, assistant/ai and system. With
window.enabled, only the last window.size turns (two messages per turn)
are kept. The current query is appended as a user message, rendered from
query_prompt_template (default {{#sys.query#}}). Without an explicit
query_prompt_template, the query is not appended when a prompt template
message already references sys.query (it would otherwise be sent twice).
Fields§
§window: Option<WindowConfig>§variable_selector: Option<Selector>§query_prompt_template: Option<Template>Implementations§
Source§impl MemoryConfig
impl MemoryConfig
Trait Implementations§
Source§impl Clone for MemoryConfig
impl Clone for MemoryConfig
Source§impl Debug for MemoryConfig
impl Debug for MemoryConfig
Source§impl Default for MemoryConfig
impl Default for MemoryConfig
Source§impl<'de> Deserialize<'de> for MemoryConfig
impl<'de> Deserialize<'de> for MemoryConfig
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 Forget for MemoryConfig
impl Freeze for MemoryConfig
impl Move for MemoryConfig
impl RefUnwindSafe for MemoryConfig
impl Send for MemoryConfig
impl Sync for MemoryConfig
impl Unpin for MemoryConfig
impl UnsafeUnpin for MemoryConfig
impl UnwindSafe for MemoryConfig
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