Skip to main content

windmill_api/models/
memory_window.rs

1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.816.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// MemoryWindow : Keeps the most recent messages of the memory named by the run's memory id (or the step's `memory_id`). Without a memory id the agent runs without memory. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct MemoryWindow {
17    #[serde(rename = "kind")]
18    pub kind: Kind,
19    /// Number of most recent messages to load and store. 0 turns memory off.
20    #[serde(rename = "context_length")]
21    pub context_length: i32,
22}
23
24impl MemoryWindow {
25    /// Keeps the most recent messages of the memory named by the run's memory id (or the step's `memory_id`). Without a memory id the agent runs without memory. 
26    pub fn new(kind: Kind, context_length: i32) -> MemoryWindow {
27        MemoryWindow {
28            kind,
29            context_length,
30        }
31    }
32}
33/// 
34#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
35pub enum Kind {
36    #[serde(rename = "window")]
37    Window,
38}
39
40impl Default for Kind {
41    fn default() -> Kind {
42        Self::Window
43    }
44}
45