Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

1.2 KB
Raw Blame
use chrono::Utc;
use model_owner::Owner;
use serde::{Deserialize, Serialize};
use uuid::Uuid;

/// A chat as displayed in Soup.
#[derive(Serialize, Clone, Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
#[cfg_attr(feature = "schema", derive(utoipa::ToSchema))]
pub struct SoupChat<T = ()> {
    /// The chat uuid
    pub id: Uuid,

    /// The name of the chat
    pub name: String,

    /// The last model selected for a sent message (`provider/model` id).
    pub model: Option<String>,

    /// Who the chat belongs to
    #[cfg_attr(feature = "schema", schema(value_type = String))]
    pub owner_id: Owner,

    /// The project id of the chat
    #[serde(skip_serializing_if = "Option::is_none")]
    pub project_id: Option<Uuid>,

    /// Whether the chat is persistent or not
    pub is_persistent: bool,

    /// The time the chat was created
    pub created_at: chrono::DateTime<Utc>,

    /// The time the chat was last updated
    pub updated_at: chrono::DateTime<Utc>,

    /// The time the chat was last viewed
    pub viewed_at: Option<chrono::DateTime<Utc>>,

    /// The time the chat was deleted
    pub deleted_at: Option<chrono::DateTime<Utc>>,

    /// Extra fields passed from above
    #[serde(flatten)]
    pub extra: T,
}