From eaf0e3022a131820d2c73d1daa9aa7282d2b5d81 Mon Sep 17 00:00:00 2001 From: "LocalAI [bot]" <139863280+localai-bot@users.noreply.github.com> Date: Wed, 20 Nov 2024 23:10:51 +0100 Subject: [PATCH] feat(swagger): update swagger (#4211) 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 | 66 ++++++++++++++++++++++++++++++++++++++++++++ swagger/swagger.json | 66 ++++++++++++++++++++++++++++++++++++++++++++ swagger/swagger.yaml | 43 +++++++++++++++++++++++++++++ 3 files changed, 175 insertions(+) diff --git a/swagger/docs.go b/swagger/docs.go index afdeb03d..1a5943c4 100644 --- a/swagger/docs.go +++ b/swagger/docs.go @@ -774,6 +774,33 @@ const docTemplate = `{ } } } + }, + "/vad": { + "post": { + "consumes": [ + "application/json" + ], + "summary": "Detect voice fragments in an audio stream", + "parameters": [ + { + "description": "query params", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/schema.VADRequest" + } + } + ], + "responses": { + "200": { + "description": "Response", + "schema": { + "$ref": "#/definitions/proto.VADResponse" + } + } + } + } } }, "definitions": { @@ -1207,6 +1234,28 @@ const docTemplate = `{ "StatusResponse_ERROR" ] }, + "proto.VADResponse": { + "type": "object", + "properties": { + "segments": { + "type": "array", + "items": { + "$ref": "#/definitions/proto.VADSegment" + } + } + } + }, + "proto.VADSegment": { + "type": "object", + "properties": { + "end": { + "type": "number" + }, + "start": { + "type": "number" + } + } + }, "schema.BackendMonitorRequest": { "type": "object", "properties": { @@ -1806,6 +1855,23 @@ const docTemplate = `{ "type": "string" } } + }, + "schema.VADRequest": { + "description": "VAD request body", + "type": "object", + "properties": { + "audio": { + "description": "model name or full path", + "type": "array", + "items": { + "type": "number" + } + }, + "model": { + "description": "model name or full path", + "type": "string" + } + } } }, "securityDefinitions": { diff --git a/swagger/swagger.json b/swagger/swagger.json index f3cfd2ca..dc902e11 100644 --- a/swagger/swagger.json +++ b/swagger/swagger.json @@ -767,6 +767,33 @@ } } } + }, + "/vad": { + "post": { + "consumes": [ + "application/json" + ], + "summary": "Detect voice fragments in an audio stream", + "parameters": [ + { + "description": "query params", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/schema.VADRequest" + } + } + ], + "responses": { + "200": { + "description": "Response", + "schema": { + "$ref": "#/definitions/proto.VADResponse" + } + } + } + } } }, "definitions": { @@ -1200,6 +1227,28 @@ "StatusResponse_ERROR" ] }, + "proto.VADResponse": { + "type": "object", + "properties": { + "segments": { + "type": "array", + "items": { + "$ref": "#/definitions/proto.VADSegment" + } + } + } + }, + "proto.VADSegment": { + "type": "object", + "properties": { + "end": { + "type": "number" + }, + "start": { + "type": "number" + } + } + }, "schema.BackendMonitorRequest": { "type": "object", "properties": { @@ -1799,6 +1848,23 @@ "type": "string" } } + }, + "schema.VADRequest": { + "description": "VAD request body", + "type": "object", + "properties": { + "audio": { + "description": "model name or full path", + "type": "array", + "items": { + "type": "number" + } + }, + "model": { + "description": "model name or full path", + "type": "string" + } + } } }, "securityDefinitions": { diff --git a/swagger/swagger.yaml b/swagger/swagger.yaml index 840a7dda..a447f7cc 100644 --- a/swagger/swagger.yaml +++ b/swagger/swagger.yaml @@ -295,6 +295,20 @@ definitions: - StatusResponse_BUSY - StatusResponse_READY - StatusResponse_ERROR + proto.VADResponse: + properties: + segments: + items: + $ref: '#/definitions/proto.VADSegment' + type: array + type: object + proto.VADSegment: + properties: + end: + type: number + start: + type: number + type: object schema.BackendMonitorRequest: properties: model: @@ -701,6 +715,18 @@ definitions: type: type: string type: object + schema.VADRequest: + description: VAD request body + properties: + audio: + description: model name or full path + items: + type: number + type: array + model: + description: model name or full path + type: string + type: object info: contact: name: LocalAI @@ -1188,6 +1214,23 @@ paths: schema: $ref: '#/definitions/schema.TokenizeResponse' summary: Tokenize the input. + /vad: + post: + consumes: + - application/json + parameters: + - description: query params + in: body + name: request + required: true + schema: + $ref: '#/definitions/schema.VADRequest' + responses: + "200": + description: Response + schema: + $ref: '#/definitions/proto.VADResponse' + summary: Detect voice fragments in an audio stream securityDefinitions: BearerAuth: in: header