1use thiserror::Error;
4
5#[derive(Debug, Error)]
7pub enum Error {
8 #[error("JSON error: {0}")]
10 Json(#[from] serde_json::Error),
11
12 #[error("Schema validation failed: {0}")]
14 ValidationFailed(String),
15
16 #[error("No tool calls found in response")]
18 NoToolCalls,
19
20 #[error("Tool call '{0}' does not match expected tool '{1}'")]
22 ToolMismatch(String, String),
23
24 #[error("Invalid response format from provider: {0}")]
26 InvalidResponseFormat(String),
27
28 #[error("Missing required field: {0}")]
30 MissingField(String),
31}
32
33pub type Result<T> = std::result::Result<T, Error>;