Skip to content

Commit fb0f188

Browse files
localai-botmudler
andauthored
feat(swagger): update swagger (#2464)
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: mudler <[email protected]>
1 parent b99182c commit fb0f188

File tree

3 files changed

+121
-3
lines changed

3 files changed

+121
-3
lines changed

swagger/docs.go

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,36 @@ const docTemplate = `{
2222
"host": "{{.Host}}",
2323
"basePath": "{{.BasePath}}",
2424
"paths": {
25+
"/tts": {
26+
"post": {
27+
"consumes": [
28+
"application/json"
29+
],
30+
"produces": [
31+
"audio/x-wav"
32+
],
33+
"summary": "Generates audio from the input text.",
34+
"parameters": [
35+
{
36+
"description": "query params",
37+
"name": "request",
38+
"in": "body",
39+
"required": true,
40+
"schema": {
41+
"$ref": "#/definitions/schema.TTSRequest"
42+
}
43+
}
44+
],
45+
"responses": {
46+
"200": {
47+
"description": "generated audio/wav file",
48+
"schema": {
49+
"type": "string"
50+
}
51+
}
52+
}
53+
}
54+
},
2555
"/v1/assistants": {
2656
"post": {
2757
"summary": "Create an assistant with a model and instructions.",
@@ -48,6 +78,12 @@ const docTemplate = `{
4878
},
4979
"/v1/audio/speech": {
5080
"post": {
81+
"consumes": [
82+
"application/json"
83+
],
84+
"produces": [
85+
"audio/x-wav"
86+
],
5187
"summary": "Generates audio from the input text.",
5288
"parameters": [
5389
{
@@ -62,7 +98,7 @@ const docTemplate = `{
6298
],
6399
"responses": {
64100
"200": {
65-
"description": "Response",
101+
"description": "generated audio/wav file",
66102
"schema": {
67103
"type": "string"
68104
}
@@ -771,18 +807,26 @@ const docTemplate = `{
771807
}
772808
},
773809
"schema.TTSRequest": {
810+
"description": "TTS request body",
774811
"type": "object",
775812
"properties": {
776813
"backend": {
777814
"type": "string"
778815
},
779816
"input": {
817+
"description": "text input",
818+
"type": "string"
819+
},
820+
"language": {
821+
"description": "(optional) language to use with TTS model",
780822
"type": "string"
781823
},
782824
"model": {
825+
"description": "model name or full path",
783826
"type": "string"
784827
},
785828
"voice": {
829+
"description": "voice audio file or speaker id",
786830
"type": "string"
787831
}
788832
}

swagger/swagger.json

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,36 @@
1515
},
1616
"basePath": "/",
1717
"paths": {
18+
"/tts": {
19+
"post": {
20+
"consumes": [
21+
"application/json"
22+
],
23+
"produces": [
24+
"audio/x-wav"
25+
],
26+
"summary": "Generates audio from the input text.",
27+
"parameters": [
28+
{
29+
"description": "query params",
30+
"name": "request",
31+
"in": "body",
32+
"required": true,
33+
"schema": {
34+
"$ref": "#/definitions/schema.TTSRequest"
35+
}
36+
}
37+
],
38+
"responses": {
39+
"200": {
40+
"description": "generated audio/wav file",
41+
"schema": {
42+
"type": "string"
43+
}
44+
}
45+
}
46+
}
47+
},
1848
"/v1/assistants": {
1949
"post": {
2050
"summary": "Create an assistant with a model and instructions.",
@@ -41,6 +71,12 @@
4171
},
4272
"/v1/audio/speech": {
4373
"post": {
74+
"consumes": [
75+
"application/json"
76+
],
77+
"produces": [
78+
"audio/x-wav"
79+
],
4480
"summary": "Generates audio from the input text.",
4581
"parameters": [
4682
{
@@ -55,7 +91,7 @@
5591
],
5692
"responses": {
5793
"200": {
58-
"description": "Response",
94+
"description": "generated audio/wav file",
5995
"schema": {
6096
"type": "string"
6197
}
@@ -764,18 +800,26 @@
764800
}
765801
},
766802
"schema.TTSRequest": {
803+
"description": "TTS request body",
767804
"type": "object",
768805
"properties": {
769806
"backend": {
770807
"type": "string"
771808
},
772809
"input": {
810+
"description": "text input",
811+
"type": "string"
812+
},
813+
"language": {
814+
"description": "(optional) language to use with TTS model",
773815
"type": "string"
774816
},
775817
"model": {
818+
"description": "model name or full path",
776819
"type": "string"
777820
},
778821
"voice": {
822+
"description": "voice audio file or speaker id",
779823
"type": "string"
780824
}
781825
}

swagger/swagger.yaml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,14 +367,21 @@ definitions:
367367
type: integer
368368
type: object
369369
schema.TTSRequest:
370+
description: TTS request body
370371
properties:
371372
backend:
372373
type: string
373374
input:
375+
description: text input
376+
type: string
377+
language:
378+
description: (optional) language to use with TTS model
374379
type: string
375380
model:
381+
description: model name or full path
376382
type: string
377383
voice:
384+
description: voice audio file or speaker id
378385
type: string
379386
type: object
380387
schema.ToolCall:
@@ -399,6 +406,25 @@ info:
399406
title: LocalAI API
400407
version: 2.0.0
401408
paths:
409+
/tts:
410+
post:
411+
consumes:
412+
- application/json
413+
parameters:
414+
- description: query params
415+
in: body
416+
name: request
417+
required: true
418+
schema:
419+
$ref: '#/definitions/schema.TTSRequest'
420+
produces:
421+
- audio/x-wav
422+
responses:
423+
"200":
424+
description: generated audio/wav file
425+
schema:
426+
type: string
427+
summary: Generates audio from the input text.
402428
/v1/assistants:
403429
post:
404430
parameters:
@@ -416,16 +442,20 @@ paths:
416442
summary: Create an assistant with a model and instructions.
417443
/v1/audio/speech:
418444
post:
445+
consumes:
446+
- application/json
419447
parameters:
420448
- description: query params
421449
in: body
422450
name: request
423451
required: true
424452
schema:
425453
$ref: '#/definitions/schema.TTSRequest'
454+
produces:
455+
- audio/x-wav
426456
responses:
427457
"200":
428-
description: Response
458+
description: generated audio/wav file
429459
schema:
430460
type: string
431461
summary: Generates audio from the input text.

0 commit comments

Comments
 (0)