Skip to main content

LLMData

Trait LLMData 

Source
pub trait LLMData:
    Validate
    + Serialize
    + DeserializeOwned
    + Sized {
    // Provided methods
    fn parse(input: &str) -> LlmJsonParseResult<Self> { ... }
    fn stringify(&self) -> Result<String, Error> { ... }
}
Expand description

Trait for Serde-powered LLM data parsing/validation/stringification.

Provided Methods§

Source

fn parse(input: &str) -> LlmJsonParseResult<Self>

Parse raw LLM output using rustia’s lenient JSON parser and then validate the shape through serde deserialization.

Source

fn stringify(&self) -> Result<String, Error>

Serialize into compact JSON text.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§