langchain_rust/agent/
error.rs1use thiserror::Error;
2
3use crate::{chain::ChainError, language_models::LLMError, prompt::PromptError};
4
5#[derive(Error, Debug)]
6pub enum AgentError {
7 #[error("LLM error: {0}")]
8 LLMError(#[from] LLMError),
9
10 #[error("Chain error: {0}")]
11 ChainError(#[from] ChainError),
12
13 #[error("Prompt error: {0}")]
14 PromptError(#[from] PromptError),
15
16 #[error("Tool error: {0}")]
17 ToolError(String),
18
19 #[error("Missing Object On Builder: {0}")]
20 MissingObject(String),
21
22 #[error("Missing input variable: {0}")]
23 MissingInputVariable(String),
24
25 #[error("Serde json error: {0}")]
26 SerdeJsonError(#[from] serde_json::Error),
27
28 #[error("Error: {0}")]
29 OtherError(String),
30}