use mime::Mime;
use url::Url;
#[derive(Debug, Clone)]
pub enum FileData {
Bytes(Vec<u8>),
Base64(String),
Url(Url),
}
#[derive(Debug, Clone)]
pub struct FileContent {
pub data: FileData,
pub file_name: Option<String>,
pub mime: Option<Mime>,
}
#[derive(Debug, Clone)]
pub struct ToolCallContent {
pub id: String,
pub tool_name: String,
pub args: serde_json::Value,
}
#[derive(Debug, Clone)]
pub struct ToolCallResultContent {
pub id: String,
pub tool_name: String,
pub args: serde_json::Value,
pub output: serde_json::Value,
pub success: bool,
}
#[derive(Debug, Clone)]
pub enum Content {
Text(String),
File(FileContent),
ToolCall(ToolCallContent),
ToolCallResult(ToolCallResultContent),
}
impl From<String> for Content {
fn from(content: String) -> Self {
Self::Text(content)
}
}
impl From<&str> for Content {
fn from(content: &str) -> Self {
Self::from(content.to_owned())
}
}