#[cfg(feature = "http-api")]
use serde::{Deserialize, Serialize};
#[cfg(feature = "http-api")]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "type")]
pub enum ClientMessage {
ChatSend {
id: String,
content: String,
},
Ping,
}
#[cfg(feature = "http-api")]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "type")]
pub enum ServerMessage {
ChatChunk {
request_id: String,
content: String,
done: bool,
},
ToolCallStarted {
request_id: String,
call_id: String,
tool_name: String,
arguments: String,
},
ToolCallResult {
request_id: String,
call_id: String,
result: String,
is_error: bool,
},
PolicyDecision {
request_id: String,
action: String,
decision: String,
reason: String,
},
Error {
request_id: Option<String>,
code: String,
message: String,
},
Pong,
}