From 5534b139033aaea59aecca3e938aa01ba0f88295 Mon Sep 17 00:00:00 2001 From: "LocalAI [bot]" <139863280+localai-bot@users.noreply.github.com> Date: Sun, 12 May 2024 23:00:18 +0200 Subject: [PATCH] feat(swagger): update swagger (#2302) Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: mudler <2420543+mudler@users.noreply.github.com> --- swagger/docs.go | 62 ++++++++++++++++++++++++++++++++++++++------ swagger/swagger.json | 62 ++++++++++++++++++++++++++++++++++++++------ swagger/swagger.yaml | 46 ++++++++++++++++++++++++++------ 3 files changed, 146 insertions(+), 24 deletions(-) diff --git a/swagger/docs.go b/swagger/docs.go index cc4fe085..ad6c44f9 100644 --- a/swagger/docs.go +++ b/swagger/docs.go @@ -269,18 +269,40 @@ const docTemplate = `{ } } }, - "functions.Item": { + "functions.FunctionProperties": { + "type": "object", + "properties": { + "arguments": { + "$ref": "#/definitions/functions.Argument" + }, + "function": { + "$ref": "#/definitions/functions.FunctionName" + } + } + }, + "functions.ItemFunction": { "type": "object", "properties": { "properties": { - "$ref": "#/definitions/functions.Properties" + "$ref": "#/definitions/functions.FunctionProperties" }, "type": { "type": "string" } } }, - "functions.JSONFunctionStructure": { + "functions.ItemName": { + "type": "object", + "properties": { + "properties": { + "$ref": "#/definitions/functions.NameProperties" + }, + "type": { + "type": "string" + } + } + }, + "functions.JSONFunctionStructureFunction": { "type": "object", "properties": { "$defs": { @@ -290,24 +312,45 @@ const docTemplate = `{ "anyOf": { "type": "array", "items": { - "$ref": "#/definitions/functions.Item" + "$ref": "#/definitions/functions.ItemFunction" } }, "oneOf": { "type": "array", "items": { - "$ref": "#/definitions/functions.Item" + "$ref": "#/definitions/functions.ItemFunction" } } } }, - "functions.Properties": { + "functions.JSONFunctionStructureName": { + "type": "object", + "properties": { + "$defs": { + "type": "object", + "additionalProperties": true + }, + "anyOf": { + "type": "array", + "items": { + "$ref": "#/definitions/functions.ItemName" + } + }, + "oneOf": { + "type": "array", + "items": { + "$ref": "#/definitions/functions.ItemName" + } + } + } + }, + "functions.NameProperties": { "type": "object", "properties": { "arguments": { "$ref": "#/definitions/functions.Argument" }, - "function": { + "name": { "$ref": "#/definitions/functions.FunctionName" } } @@ -572,7 +615,10 @@ const docTemplate = `{ "type": "string" }, "grammar_json_functions": { - "$ref": "#/definitions/functions.JSONFunctionStructure" + "$ref": "#/definitions/functions.JSONFunctionStructureFunction" + }, + "grammar_json_name": { + "$ref": "#/definitions/functions.JSONFunctionStructureName" }, "ignore_eos": { "type": "boolean" diff --git a/swagger/swagger.json b/swagger/swagger.json index d7febeb3..862327f9 100644 --- a/swagger/swagger.json +++ b/swagger/swagger.json @@ -262,18 +262,40 @@ } } }, - "functions.Item": { + "functions.FunctionProperties": { + "type": "object", + "properties": { + "arguments": { + "$ref": "#/definitions/functions.Argument" + }, + "function": { + "$ref": "#/definitions/functions.FunctionName" + } + } + }, + "functions.ItemFunction": { "type": "object", "properties": { "properties": { - "$ref": "#/definitions/functions.Properties" + "$ref": "#/definitions/functions.FunctionProperties" }, "type": { "type": "string" } } }, - "functions.JSONFunctionStructure": { + "functions.ItemName": { + "type": "object", + "properties": { + "properties": { + "$ref": "#/definitions/functions.NameProperties" + }, + "type": { + "type": "string" + } + } + }, + "functions.JSONFunctionStructureFunction": { "type": "object", "properties": { "$defs": { @@ -283,24 +305,45 @@ "anyOf": { "type": "array", "items": { - "$ref": "#/definitions/functions.Item" + "$ref": "#/definitions/functions.ItemFunction" } }, "oneOf": { "type": "array", "items": { - "$ref": "#/definitions/functions.Item" + "$ref": "#/definitions/functions.ItemFunction" } } } }, - "functions.Properties": { + "functions.JSONFunctionStructureName": { + "type": "object", + "properties": { + "$defs": { + "type": "object", + "additionalProperties": true + }, + "anyOf": { + "type": "array", + "items": { + "$ref": "#/definitions/functions.ItemName" + } + }, + "oneOf": { + "type": "array", + "items": { + "$ref": "#/definitions/functions.ItemName" + } + } + } + }, + "functions.NameProperties": { "type": "object", "properties": { "arguments": { "$ref": "#/definitions/functions.Argument" }, - "function": { + "name": { "$ref": "#/definitions/functions.FunctionName" } } @@ -565,7 +608,10 @@ "type": "string" }, "grammar_json_functions": { - "$ref": "#/definitions/functions.JSONFunctionStructure" + "$ref": "#/definitions/functions.JSONFunctionStructureFunction" + }, + "grammar_json_name": { + "$ref": "#/definitions/functions.JSONFunctionStructureName" }, "ignore_eos": { "type": "boolean" diff --git a/swagger/swagger.yaml b/swagger/swagger.yaml index 919dd896..7c58c63c 100644 --- a/swagger/swagger.yaml +++ b/swagger/swagger.yaml @@ -23,32 +23,60 @@ definitions: const: type: string type: object - functions.Item: + functions.FunctionProperties: + properties: + arguments: + $ref: '#/definitions/functions.Argument' + function: + $ref: '#/definitions/functions.FunctionName' + type: object + functions.ItemFunction: properties: properties: - $ref: '#/definitions/functions.Properties' + $ref: '#/definitions/functions.FunctionProperties' type: type: string type: object - functions.JSONFunctionStructure: + functions.ItemName: + properties: + properties: + $ref: '#/definitions/functions.NameProperties' + type: + type: string + type: object + functions.JSONFunctionStructureFunction: properties: $defs: additionalProperties: true type: object anyOf: items: - $ref: '#/definitions/functions.Item' + $ref: '#/definitions/functions.ItemFunction' type: array oneOf: items: - $ref: '#/definitions/functions.Item' + $ref: '#/definitions/functions.ItemFunction' type: array type: object - functions.Properties: + functions.JSONFunctionStructureName: + properties: + $defs: + additionalProperties: true + type: object + anyOf: + items: + $ref: '#/definitions/functions.ItemName' + type: array + oneOf: + items: + $ref: '#/definitions/functions.ItemName' + type: array + type: object + functions.NameProperties: properties: arguments: $ref: '#/definitions/functions.Argument' - function: + name: $ref: '#/definitions/functions.FunctionName' type: object functions.Tool: @@ -227,7 +255,9 @@ definitions: description: A grammar to constrain the LLM output type: string grammar_json_functions: - $ref: '#/definitions/functions.JSONFunctionStructure' + $ref: '#/definitions/functions.JSONFunctionStructureFunction' + grammar_json_name: + $ref: '#/definitions/functions.JSONFunctionStructureName' ignore_eos: type: boolean input: {}