Skip to main content

parse_tools_oaicompat

Function parse_tools_oaicompat 

Source
pub fn parse_tools_oaicompat(tools_json: &str) -> Result<String, ChatError>
Expand description

Validate and normalise an OpenAI-shaped tools array into a JSON array of {"name", "description", "parameters"}.

ยงErrors

Returns ChatError::BadJson if the input is not valid JSON, or ChatError::Failed if it is not a valid tool array.