Skip to main content

llama_cpp_bindings/error/
paired_quote_failure.rs

1/// Failures specific to the paired-quote args parser (Gemma 4 `<|tool_call>call:name{key:<|"|>val<|"|>}`).
2#[derive(Debug, thiserror::Error)]
3pub enum PairedQuoteFailure {
4    #[error("empty key in tool call '{tool_name}' arguments")]
5    EmptyKey { tool_name: String },
6    #[error("tool call '{tool_name}' translated arguments are not valid JSON: {message}")]
7    InvalidJsonArguments { tool_name: String, message: String },
8    #[error("tool call '{tool_name}' has unclosed quoted value for key '{key}'")]
9    UnclosedQuotedValue { tool_name: String, key: String },
10    #[error("tool call '{tool_name}' arguments ended without close marker (state: {state})")]
11    UnclosedArgumentBlock {
12        tool_name: String,
13        state: &'static str,
14    },
15    #[error(
16        "tool call '{tool_name}' has unexpected character '{character}' after value for key '{key}'"
17    )]
18    UnexpectedCharAfterValue {
19        tool_name: String,
20        key: String,
21        character: char,
22    },
23}