adk_eval/
error.rs

1//! Error types for the evaluation framework
2
3use thiserror::Error;
4
5/// Result type alias for evaluation operations
6pub type Result<T> = std::result::Result<T, EvalError>;
7
8/// Errors that can occur during evaluation
9#[derive(Error, Debug)]
10pub enum EvalError {
11    /// Failed to load test file
12    #[error("Failed to load test file: {0}")]
13    LoadError(String),
14
15    /// Failed to parse test file
16    #[error("Failed to parse test file: {0}")]
17    ParseError(String),
18
19    /// Test case execution failed
20    #[error("Test case execution failed: {0}")]
21    ExecutionError(String),
22
23    /// Agent error during evaluation
24    #[error("Agent error: {0}")]
25    AgentError(String),
26
27    /// Invalid configuration
28    #[error("Invalid configuration: {0}")]
29    ConfigError(String),
30
31    /// IO error
32    #[error("IO error: {0}")]
33    IoError(#[from] std::io::Error),
34
35    /// JSON serialization error
36    #[error("JSON error: {0}")]
37    JsonError(#[from] serde_json::Error),
38
39    /// Scoring error
40    #[error("Scoring error: {0}")]
41    ScoringError(String),
42
43    /// LLM judge error
44    #[error("LLM judge error: {0}")]
45    JudgeError(String),
46}
47
48impl From<adk_core::AdkError> for EvalError {
49    fn from(err: adk_core::AdkError) -> Self {
50        EvalError::AgentError(err.to_string())
51    }
52}