feat(swagger): update swagger (#2858)

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: mudler <2420543+mudler@users.noreply.github.com>
This commit is contained in:
LocalAI [bot] 2024-07-14 23:44:18 +02:00 committed by GitHub
parent 06c315bcb3
commit 23835f8cca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 1026 additions and 0 deletions

View file

@ -22,6 +22,134 @@ const docTemplate = `{
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/models/apply": {
"post": {
"summary": "Install models to LocalAI.",
"parameters": [
{
"description": "query params",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/localai.GalleryModel"
}
}
],
"responses": {
"200": {
"description": "Response",
"schema": {
"$ref": "#/definitions/schema.GalleryResponse"
}
}
}
}
},
"/models/available": {
"get": {
"summary": "List installable models.",
"responses": {
"200": {
"description": "Response",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/gallery.GalleryModel"
}
}
}
}
}
},
"/models/delete/{name}": {
"post": {
"summary": "delete models to LocalAI.",
"parameters": [
{
"type": "string",
"description": "Model name",
"name": "name",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Response",
"schema": {
"$ref": "#/definitions/schema.GalleryResponse"
}
}
}
}
},
"/models/galleries": {
"get": {
"summary": "List all Galleries",
"responses": {
"200": {
"description": "Response",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/config.Gallery"
}
}
}
}
},
"post": {
"summary": "Adds a gallery in LocalAI",
"parameters": [
{
"description": "Gallery details",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/config.Gallery"
}
}
],
"responses": {
"200": {
"description": "Response",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/config.Gallery"
}
}
}
}
},
"delete": {
"summary": "removes a gallery from LocalAI",
"parameters": [
{
"description": "Gallery details",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/config.Gallery"
}
}
],
"responses": {
"200": {
"description": "Response",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/config.Gallery"
}
}
}
}
}
},
"/tts": {
"post": {
"consumes": [
@ -287,6 +415,30 @@ const docTemplate = `{
}
}
},
"/v1/rerank": {
"post": {
"summary": "Reranks a list of phrases by relevance to a given text query.",
"parameters": [
{
"description": "query params",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/schema.JINARerankRequest"
}
}
],
"responses": {
"200": {
"description": "Response",
"schema": {
"$ref": "#/definitions/schema.JINARerankResponse"
}
}
}
}
},
"/v1/text-to-speech/{voice-id}": {
"post": {
"summary": "Generates audio from the input text.",
@ -320,6 +472,17 @@ const docTemplate = `{
}
},
"definitions": {
"config.Gallery": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"functions.Argument": {
"type": "object",
"properties": {
@ -452,6 +615,148 @@ const docTemplate = `{
}
}
},
"gallery.File": {
"type": "object",
"properties": {
"filename": {
"type": "string"
},
"sha256": {
"type": "string"
},
"uri": {
"type": "string"
}
}
},
"gallery.GalleryModel": {
"type": "object",
"properties": {
"config_file": {
"description": "config_file is read in the situation where URL is blank - and therefore this is a base config.",
"type": "object",
"additionalProperties": true
},
"description": {
"type": "string"
},
"files": {
"description": "AdditionalFiles are used to add additional files to the model",
"type": "array",
"items": {
"$ref": "#/definitions/gallery.File"
}
},
"gallery": {
"description": "Gallery is a reference to the gallery which contains the model",
"allOf": [
{
"$ref": "#/definitions/config.Gallery"
}
]
},
"icon": {
"type": "string"
},
"installed": {
"description": "Installed is used to indicate if the model is installed or not",
"type": "boolean"
},
"license": {
"type": "string"
},
"name": {
"type": "string"
},
"overrides": {
"description": "Overrides are used to override the configuration of the model located at URL",
"type": "object",
"additionalProperties": true
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"url": {
"type": "string"
},
"urls": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"localai.GalleryModel": {
"type": "object",
"properties": {
"config_file": {
"description": "config_file is read in the situation where URL is blank - and therefore this is a base config.",
"type": "object",
"additionalProperties": true
},
"config_url": {
"type": "string"
},
"description": {
"type": "string"
},
"files": {
"description": "AdditionalFiles are used to add additional files to the model",
"type": "array",
"items": {
"$ref": "#/definitions/gallery.File"
}
},
"gallery": {
"description": "Gallery is a reference to the gallery which contains the model",
"allOf": [
{
"$ref": "#/definitions/config.Gallery"
}
]
},
"icon": {
"type": "string"
},
"id": {
"type": "string"
},
"installed": {
"description": "Installed is used to indicate if the model is installed or not",
"type": "boolean"
},
"license": {
"type": "string"
},
"name": {
"type": "string"
},
"overrides": {
"description": "Overrides are used to override the configuration of the model located at URL",
"type": "object",
"additionalProperties": true
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"url": {
"type": "string"
},
"urls": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"openai.Assistant": {
"type": "object",
"properties": {
@ -636,6 +941,17 @@ const docTemplate = `{
}
}
},
"schema.GalleryResponse": {
"type": "object",
"properties": {
"status": {
"type": "string"
},
"uuid": {
"type": "string"
}
}
},
"schema.Item": {
"type": "object",
"properties": {
@ -660,6 +976,76 @@ const docTemplate = `{
}
}
},
"schema.JINADocumentResult": {
"type": "object",
"properties": {
"document": {
"$ref": "#/definitions/schema.JINAText"
},
"index": {
"type": "integer"
},
"relevance_score": {
"type": "number"
}
}
},
"schema.JINARerankRequest": {
"type": "object",
"properties": {
"documents": {
"type": "array",
"items": {
"type": "string"
}
},
"model": {
"type": "string"
},
"query": {
"type": "string"
},
"top_n": {
"type": "integer"
}
}
},
"schema.JINARerankResponse": {
"type": "object",
"properties": {
"model": {
"type": "string"
},
"results": {
"type": "array",
"items": {
"$ref": "#/definitions/schema.JINADocumentResult"
}
},
"usage": {
"$ref": "#/definitions/schema.JINAUsageInfo"
}
}
},
"schema.JINAText": {
"type": "object",
"properties": {
"text": {
"type": "string"
}
}
},
"schema.JINAUsageInfo": {
"type": "object",
"properties": {
"prompt_tokens": {
"type": "integer"
},
"total_tokens": {
"type": "integer"
}
}
},
"schema.Message": {
"type": "object",
"properties": {