mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-20 02:24:59 +00:00
feat(swagger): update swagger (#2908)
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:
parent
96f67efe32
commit
919e2e4369
3 changed files with 864 additions and 83 deletions
355
swagger/docs.go
355
swagger/docs.go
|
@ -51,6 +51,64 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"/backend/monitor": {
|
||||
"get": {
|
||||
"summary": "Backend monitor endpoint",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "Backend statistics request",
|
||||
"name": "request",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/schema.BackendMonitorRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Response",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/proto.StatusResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/backend/shutdown": {
|
||||
"post": {
|
||||
"summary": "Backend monitor endpoint",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "Backend statistics request",
|
||||
"name": "request",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/schema.BackendMonitorRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {}
|
||||
}
|
||||
},
|
||||
"/metrics": {
|
||||
"get": {
|
||||
"summary": "Prometheus metrics endpoint",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "Gallery details",
|
||||
"name": "request",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/config.Gallery"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {}
|
||||
}
|
||||
},
|
||||
"/models/apply": {
|
||||
"post": {
|
||||
"summary": "Install models to LocalAI.",
|
||||
|
@ -179,6 +237,35 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"/models/jobs": {
|
||||
"get": {
|
||||
"summary": "Returns all the jobs status progress",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Response",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"$ref": "#/definitions/gallery.GalleryOpStatus"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/models/jobs/{uuid}": {
|
||||
"get": {
|
||||
"summary": "Returns the job status",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Response",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gallery.GalleryOpStatus"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/tts": {
|
||||
"post": {
|
||||
"consumes": [
|
||||
|
@ -210,6 +297,46 @@ const docTemplate = `{
|
|||
}
|
||||
},
|
||||
"/v1/assistants": {
|
||||
"get": {
|
||||
"summary": "List available assistents",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Limit the number of assistants returned",
|
||||
"name": "limit",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Order of assistants returned",
|
||||
"name": "order",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Return assistants created after the given ID",
|
||||
"name": "after",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Return assistants created before the given ID",
|
||||
"name": "before",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Response",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/openai.Assistant"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"summary": "Create an assistant with a model and instructions.",
|
||||
"parameters": [
|
||||
|
@ -233,6 +360,30 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"/v1/assistants/{assistant_id}": {
|
||||
"get": {
|
||||
"summary": "Get assistent data",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Response",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/openai.Assistant"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"delete": {
|
||||
"summary": "Delete assistents",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Response",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/schema.DeleteAssistantResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/audio/speech": {
|
||||
"post": {
|
||||
"consumes": [
|
||||
|
@ -346,6 +497,30 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"/v1/edits": {
|
||||
"post": {
|
||||
"summary": "OpenAI edit endpoint",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "query params",
|
||||
"name": "request",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/schema.OpenAIRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Response",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/schema.OpenAIResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/embeddings": {
|
||||
"post": {
|
||||
"summary": "Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.",
|
||||
|
@ -370,6 +545,19 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"/v1/files": {
|
||||
"get": {
|
||||
"summary": "List files.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Response",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/schema.ListFiles"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/files/{file_id}": {
|
||||
"get": {
|
||||
"summary": "Returns information about a specific file.",
|
||||
|
@ -377,7 +565,7 @@ const docTemplate = `{
|
|||
"200": {
|
||||
"description": "Response",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/openai.File"
|
||||
"$ref": "#/definitions/schema.File"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -719,6 +907,37 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"gallery.GalleryOpStatus": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"deletion": {
|
||||
"description": "Deletion is true if the operation is a deletion",
|
||||
"type": "boolean"
|
||||
},
|
||||
"downloaded_size": {
|
||||
"type": "string"
|
||||
},
|
||||
"error": {},
|
||||
"file_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"file_size": {
|
||||
"type": "string"
|
||||
},
|
||||
"gallery_model_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"message": {
|
||||
"type": "string"
|
||||
},
|
||||
"processed": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"progress": {
|
||||
"type": "number"
|
||||
}
|
||||
}
|
||||
},
|
||||
"localai.GalleryModel": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -889,35 +1108,6 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"openai.File": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"bytes": {
|
||||
"description": "Size of the file in bytes",
|
||||
"type": "integer"
|
||||
},
|
||||
"created_at": {
|
||||
"description": "The time at which the file was created",
|
||||
"type": "string"
|
||||
},
|
||||
"filename": {
|
||||
"description": "The name of the file",
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"description": "Unique identifier for the file",
|
||||
"type": "string"
|
||||
},
|
||||
"object": {
|
||||
"description": "Type of the object (e.g., \"file\")",
|
||||
"type": "string"
|
||||
},
|
||||
"purpose": {
|
||||
"description": "The purpose of the file (e.g., \"fine-tune\", \"classifications\", etc.)",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"openai.Tool": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -956,6 +1146,54 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"proto.MemoryUsageData": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"breakdown": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"total": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"proto.StatusResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"memory": {
|
||||
"$ref": "#/definitions/proto.MemoryUsageData"
|
||||
},
|
||||
"state": {
|
||||
"$ref": "#/definitions/proto.StatusResponse_State"
|
||||
}
|
||||
}
|
||||
},
|
||||
"proto.StatusResponse_State": {
|
||||
"type": "integer",
|
||||
"enum": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
-1
|
||||
],
|
||||
"x-enum-varnames": [
|
||||
"StatusResponse_UNINITIALIZED",
|
||||
"StatusResponse_BUSY",
|
||||
"StatusResponse_READY",
|
||||
"StatusResponse_ERROR"
|
||||
]
|
||||
},
|
||||
"schema.BackendMonitorRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"model": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema.Choice": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -976,6 +1214,49 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"schema.DeleteAssistantResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"deleted": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"object": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema.File": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"bytes": {
|
||||
"description": "Size of the file in bytes",
|
||||
"type": "integer"
|
||||
},
|
||||
"created_at": {
|
||||
"description": "The time at which the file was created",
|
||||
"type": "string"
|
||||
},
|
||||
"filename": {
|
||||
"description": "The name of the file",
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"description": "Unique identifier for the file",
|
||||
"type": "string"
|
||||
},
|
||||
"object": {
|
||||
"description": "Type of the object (e.g., \"file\")",
|
||||
"type": "string"
|
||||
},
|
||||
"purpose": {
|
||||
"description": "The purpose of the file (e.g., \"fine-tune\", \"classifications\", etc.)",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema.FunctionCall": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -1092,6 +1373,20 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"schema.ListFiles": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/schema.File"
|
||||
}
|
||||
},
|
||||
"object": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema.Message": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue