llm-agent 0.3.0

The agent library to build LLM applications that work with any LLM providers.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use thiserror::Error;

#[derive(Debug, Error)]
pub enum AgentError {
    #[error("Language model error: {0}")]
    LanguageModel(#[from] llm_sdk::LanguageModelError),
    #[error("Invariant: {0}")]
    Invariant(String),
    #[error("Tool execution error: {0}")]
    ToolExecution(#[source] BoxedError),
    #[error("Run initialization error: {0}")]
    Init(#[source] BoxedError),
    #[error("The maximum number of turns ({0}) has been exceeded.")]
    MaxTurnsExceeded(usize),
}

pub type BoxedError = Box<dyn std::error::Error + Send + Sync>;