Trait llm_sdk::ToSchema

source ·
pub trait ToSchema: JsonSchema {
    // Required method
    fn to_schema() -> Value;
}
Expand description

For tool function. If you have a function that you want ChatGPT to call, you shall put all params into a struct and derive schemars::JsonSchema for it. Then you can use YourStruct::to_schema() to generate json schema for tools.

Required Methods§

Object Safety§

This trait is not object safe.

Implementors§