swiftide_core/chat_completion/
errors.rsuse thiserror::Error;
use crate::CommandError;
#[derive(Error, Debug)]
pub enum ToolError {
    #[error("arguments for tool failed to parse")]
    WrongArguments(#[from] serde_json::Error),
    #[error("no arguments provided for tool {0:#}")]
    MissingArguments(String),
    #[error("tool execution failed: {0:#}")]
    ExecutionFailed(#[from] CommandError),
    #[error(transparent)]
    Unknown(#[from] anyhow::Error),
}
#[derive(Error, Debug)]
pub enum ChatCompletionError {
    #[error("llm returned an error: {0}")]
    LLM(Box<dyn std::error::Error + Send + Sync>),
    #[error(transparent)]
    Unknown(#[from] anyhow::Error),
}