use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct ChatSessionChatkitConfiguration {
#[serde(rename = "automatic_thread_titling")]
pub automatic_thread_titling: Box<models::ChatSessionAutomaticThreadTitling>,
#[serde(rename = "file_upload")]
pub file_upload: Box<models::ChatSessionFileUpload>,
#[serde(rename = "history")]
pub history: Box<models::ChatSessionHistory>,
}
impl ChatSessionChatkitConfiguration {
pub fn new(
automatic_thread_titling: models::ChatSessionAutomaticThreadTitling,
file_upload: models::ChatSessionFileUpload,
history: models::ChatSessionHistory,
) -> ChatSessionChatkitConfiguration {
ChatSessionChatkitConfiguration {
automatic_thread_titling: Box::new(automatic_thread_titling),
file_upload: Box::new(file_upload),
history: Box::new(history),
}
}
}
impl std::fmt::Display for ChatSessionChatkitConfiguration {
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),
}
}
}