Skip to main content

llama_cpp_bindings/error/
chat_template_error.rs

1use std::ffi::NulError;
2
3/// There was an error while getting the chat template from a model.
4#[derive(Debug, Eq, PartialEq, thiserror::Error)]
5pub enum ChatTemplateError {
6    /// gguf has no chat template (by that name)
7    #[error("chat template not found - returned null pointer")]
8    MissingTemplate,
9
10    /// chat template contained a null byte
11    #[error("null byte in string {0}")]
12    NullError(#[from] NulError),
13
14    /// The chat template was not valid utf8.
15    #[error(transparent)]
16    Utf8Error(#[from] std::str::Utf8Error),
17}