use serde::{Deserialize, Serialize};
use serde_json::Value;

#[derive(Deserialize)]
pub struct ChatRequest {
    pub messages: Vec<ChatMessage>,
    #[serde(default)]
    pub system: Option<String>,
}

#[derive(Deserialize)]
pub struct ChatMessage {
    pub role: String,
    pub content: String,
}

#[derive(Serialize)]
pub struct ChatResponse {
    pub response: String,
    pub messages: Value,
}

#[derive(Serialize)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum StreamEventDto {
    Content { text: String },
    ToolUse { name: String, output: String },
    Done,
    Error { message: String },
}
