File size: 1,438 Bytes
e5034c3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
use forge_domain::{ConversationId, InterruptionReason, ToolCallArgumentError, ToolName};

#[derive(thiserror::Error, Debug)]
pub enum Error {
    #[error("Invalid tool call arguments: {0}")]
    CallArgument(ToolCallArgumentError),

    #[error("Tool {0} not found")]
    NotFound(ToolName),

    #[error("Tool '{tool_name}' timed out after {timeout} minutes")]
    CallTimeout { tool_name: ToolName, timeout: u64 },

    #[error(
        "Tool '{name}' is not available. Please try again with one of these tools: [{supported_tools}]"
    )]
    NotAllowed {
        name: ToolName,
        supported_tools: String,
    },

    #[error(
        "Tool '{tool_name}' requires {required_modality} modality, but model only supports: {supported_modalities}"
    )]
    UnsupportedModality {
        tool_name: ToolName,
        required_modality: String,
        supported_modalities: String,
    },

    #[error("Empty tool response")]
    EmptyToolResponse,

    #[error("Agent execution was interrupted: {0:?}")]
    AgentToolInterrupted(InterruptionReason),

    #[error("Authentication still in progress")]
    AuthInProgress,

    #[error("Agent '{0}' not found")]
    AgentNotFound(forge_domain::AgentId),

    #[error("Conversation '{id}' not found")]
    ConversationNotFound { id: ConversationId },

    #[error("No active provider configured")]
    NoActiveProvider,

    #[error("No active model configured")]
    NoActiveModel,
}