Skip to main content

Module json_schema

Module json_schema 

Source
Expand description

Conversion of JSON Schema (draft 7) to the OpenAPI 3.0 schema subset accepted by the Gemini API (responseSchema, function parameters).

Derived from the Vercel AI SDK (Apache-2.0, Copyright 2023 Vercel, Inc.), translated from TypeScript to Rust and modified; see NOTICE.

Constants§

RECURSIVE_REFERENCE_PREFIX
Prefix of the functionality of a recursive-reference error.

Functions§

convert_json_schema_to_openapi_schema
Converts schema to an OpenAPI schema.
is_recursive_reference_error
Whether error reports a recursive $ref (callers fall back to parametersJsonSchema).