alith_interface/requests/completion/
error.rs

1#[derive(Debug, thiserror::Error)]
2pub enum CompletionError {
3    // Break on these types
4    #[error("RequestBuilderError: {0}")]
5    RequestBuilderError(String),
6    #[error("ClientError: {0}")]
7    ClientError(#[from] crate::llms::api::error::ClientError),
8    #[error("LocalClientError: {0}")]
9    LocalClientError(String),
10    #[error("RequestTokenLimitError: {0}")]
11    RequestTokenLimitError(#[from] alith_prompt::RequestTokenLimitError),
12    #[error("StopReasonUnsupported: {0}")]
13    StopReasonUnsupported(String),
14    #[error("ExceededRetryCount")]
15    ExceededRetryCount {
16        message: String,
17        errors: Vec<CompletionError>,
18    },
19    // Continue on these types
20    #[error("ResponseContentEmpty: Response had no content")]
21    ResponseContentEmpty,
22    #[error("StopLimitRetry: stopped_limit == true && retry_stopped_limit == true")]
23    StopLimitRetry,
24    #[error("NoRequiredStopSequence: One of the sequences is required, but response has has None.")]
25    NoRequiredStopSequence,
26    #[error(
27        "NonMatchingStopSequence: One of the sequences is required, but response's stop sequence was: {0}."
28    )]
29    NonMatchingStopSequence(String),
30    /// Json serialization or deserialization errors
31    #[error("JsonError: {0}")]
32    JsonError(#[from] serde_json::Error),
33}