use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct ContextManagementParam {
#[serde(rename = "type")]
pub r#type: String,
#[serde(
rename = "compact_threshold",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub compact_threshold: Option<Option<i32>>,
}
impl ContextManagementParam {
pub fn new(r#type: String) -> ContextManagementParam {
ContextManagementParam {
r#type,
compact_threshold: None,
}
}
}
impl std::fmt::Display for ContextManagementParam {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match serde_json::to_string(self) {
Ok(s) => write!(f, "{}", s),
Err(_) => Err(std::fmt::Error),
}
}
}