49 lines
1.2 KiB
Rust
49 lines
1.2 KiB
Rust
use chrono::{DateTime, Utc};
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
use models::{RoomId, Uuid};
|
|
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
|
#[serde(rename_all = "snake_case")]
|
|
pub enum AiEventType {
|
|
AgentJoined,
|
|
AgentLeft,
|
|
AgentStatusChanged,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
#[serde(tag = "type", rename_all = "snake_case")]
|
|
pub enum AiEvent {
|
|
AgentJoined(AiAgentJoinedService),
|
|
AgentLeft(AiAgentLeftService),
|
|
AgentStatusChanged(AiAgentStatusChangedService),
|
|
}
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub struct AiAgentJoinedService {
|
|
pub room: RoomId,
|
|
pub agent_id: Uuid,
|
|
pub agent_name: String,
|
|
pub agent_type: String,
|
|
pub model_name: Option<String>,
|
|
pub joined_at: DateTime<Utc>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub struct AiAgentLeftService {
|
|
pub room: RoomId,
|
|
pub agent_id: Uuid,
|
|
pub agent_name: String,
|
|
pub left_at: DateTime<Utc>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub struct AiAgentStatusChangedService {
|
|
pub room: RoomId,
|
|
pub agent_id: Uuid,
|
|
pub agent_name: String,
|
|
pub old_status: String,
|
|
pub new_status: String,
|
|
pub changed_at: DateTime<Utc>,
|
|
}
|