Skip to main content

OpenAiSerializable

Trait OpenAiSerializable 

Source
pub trait OpenAiSerializable: Sized {
    // Required method
    fn openai_output_schema() -> Value;

    // Provided methods
    fn to_openai_value(&self) -> Result<Value>
       where Self: Serialize { ... }
    fn from_openai_value(value: Value) -> Result<Self>
       where Self: DeserializeOwned { ... }
}

Required Methods§

Provided Methods§

Source

fn to_openai_value(&self) -> Result<Value>
where Self: Serialize,

Source

fn from_openai_value(value: Value) -> Result<Self>
where Self: DeserializeOwned,

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§