use serde::Serialize;
pub use daimon_core::ToolCall;
#[derive(Debug, Clone)]
pub struct ToolOutput {
pub content: String,
pub is_error: bool,
}
impl ToolOutput {
pub fn text(content: impl Into<String>) -> Self {
Self {
content: content.into(),
is_error: false,
}
}
pub fn json(value: &impl Serialize) -> crate::error::Result<Self> {
Ok(Self {
content: serde_json::to_string(value)?,
is_error: false,
})
}
pub fn error(content: impl Into<String>) -> Self {
Self {
content: content.into(),
is_error: true,
}
}
}
#[derive(Debug, Clone, Default)]
pub enum ToolChoice {
#[default]
Auto,
None,
Required,
Specific(String),
}