From ba106a776bb81d1182fcd3eebee06b10604d730e Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Wed, 25 Oct 2023 10:18:59 -0700 Subject: [PATCH] (docs) openapi.json fix ChatCompletion Response output --- openai-proxy/openapi.json | 106 ++++++++++++++++++++------------------ 1 file changed, 57 insertions(+), 49 deletions(-) diff --git a/openai-proxy/openapi.json b/openai-proxy/openapi.json index 529cd74a3..c72d55212 100644 --- a/openai-proxy/openapi.json +++ b/openai-proxy/openapi.json @@ -176,58 +176,66 @@ "required": ["messages", "model"] }, "ChatCompletionsResponse": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "choices": { - "type": "array", - "items": { - "type": "object", - "properties": { - "finish_reason": { - "type": "string" - }, - "index": { - "type": "integer" - }, - "message": { - "type": "object", - "properties": { - "created": { - "type": "integer" - }, - "model": { - "type": "string" - }, - "object": { - "type": "string" - } - }, - "required": ["created", "model", "object"] - }, - "usage": { - "type": "object", - "properties": { - "completion_tokens": { - "type": "integer" - }, - "prompt_tokens": { - "type": "integer" - }, - "total_tokens": { - "type": "integer" - } - }, - "required": ["completion_tokens", "prompt_tokens", "total_tokens"] - } + "type": "object", + "properties": { + "object": { + "type": "string" + }, + "choices": { + "type": "array", + "items": { + "type": "object", + "properties": { + "finish_reason": { + "type": "string" }, - "required": ["finish_reason", "index", "message", "usage"] - } + "index": { + "type": "integer" + }, + "message": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "role": { + "type": "string" + } + }, + "required": ["content", "role"] + }, + "usage": { + "type": "object", + "properties": { + "prompt_tokens": { + "type": "integer" + }, + "completion_tokens": { + "type": "integer" + }, + "total_tokens": { + "type": "integer" + } + }, + "required": ["prompt_tokens", "completion_tokens", "total_tokens"] + } + }, + "required": ["finish_reason", "index", "message", "usage"] } + }, + "id": { + "type": "string" + }, + "created": { + "type": "number" + }, + "model": { + "type": "string" } - } + }, + "required": ["object", "choices", "id", "created", "model"] + } + } } }