From 25dfb11fd0b159b0e8bc2e13ede5aeed2ed55a4d Mon Sep 17 00:00:00 2001 From: Alexander Song Date: Tue, 28 Jan 2025 21:12:06 -0800 Subject: [PATCH] recompile openapi schema --- schemas/openapi.json | 83 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 77 insertions(+), 6 deletions(-) diff --git a/schemas/openapi.json b/schemas/openapi.json index eabea2a496..86fc6bfc69 100644 --- a/schemas/openapi.json +++ b/schemas/openapi.json @@ -2241,19 +2241,79 @@ ], "title": "PromptMessageRole" }, - "PromptOutputSchema": { + "PromptOpenAIJSONSchema": { "properties": { - "definition": { + "name": { + "type": "string", + "title": "Name" + }, + "description": { + "type": "string", + "title": "Description" + }, + "schema": { "type": "object", - "title": "Definition" + "title": "Schema" + }, + "strict": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Strict" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "name", + "schema" + ], + "title": "PromptOpenAIJSONSchema", + "description": "Based on https://github.com/openai/openai-python/blob/d16e6edde5a155626910b5758a0b939bfedb9ced/src/openai/types/shared/response_format_json_schema.py#L13" + }, + "PromptOpenAIOutputSchema": { + "properties": { + "version": { + "type": "string", + "const": "openai-output-schema-v1", + "title": "Version" + }, + "definition": { + "$ref": "#/components/schemas/PromptOpenAIResponseFormatJSONSchema" } }, "additionalProperties": false, "type": "object", "required": [ + "version", "definition" ], - "title": "PromptOutputSchema" + "title": "PromptOpenAIOutputSchema" + }, + "PromptOpenAIResponseFormatJSONSchema": { + "properties": { + "json_schema": { + "$ref": "#/components/schemas/PromptOpenAIJSONSchema" + }, + "type": { + "type": "string", + "const": "json_schema", + "title": "Type" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "json_schema", + "type" + ], + "title": "PromptOpenAIResponseFormatJSONSchema", + "description": "Based on https://github.com/openai/openai-python/blob/d16e6edde5a155626910b5758a0b939bfedb9ced/src/openai/types/shared/response_format_json_schema.py#L40" }, "PromptStringTemplateV1": { "properties": { @@ -2390,12 +2450,23 @@ "output_schema": { "anyOf": [ { - "$ref": "#/components/schemas/PromptOutputSchema" + "oneOf": [ + { + "$ref": "#/components/schemas/PromptOpenAIOutputSchema" + } + ], + "discriminator": { + "propertyName": "version", + "mapping": { + "openai-output-schema-v1": "#/components/schemas/PromptOpenAIOutputSchema" + } + } }, { "type": "null" } - ] + ], + "title": "Output Schema" } }, "type": "object",