Skip to content

Commit 62d0d00

Browse files
localai-botmudler
andauthored
feat(swagger): update swagger (#4155)
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: mudler <2420543+mudler@users.noreply.github.com>
1 parent de2b574 commit 62d0d00

File tree

3 files changed

+200
-37
lines changed

3 files changed

+200
-37
lines changed

swagger/docs.go

Lines changed: 76 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,25 @@ const docTemplate = `{
279279
}
280280
}
281281
},
282+
"/tokenMetrics": {
283+
"get": {
284+
"consumes": [
285+
"application/json"
286+
],
287+
"produces": [
288+
"audio/x-wav"
289+
],
290+
"summary": "Get TokenMetrics for Active Slot.",
291+
"responses": {
292+
"200": {
293+
"description": "generated audio/wav file",
294+
"schema": {
295+
"type": "string"
296+
}
297+
}
298+
}
299+
}
300+
},
282301
"/tts": {
283302
"post": {
284303
"consumes": [
@@ -723,6 +742,38 @@ const docTemplate = `{
723742
}
724743
}
725744
}
745+
},
746+
"/v1/tokenMetrics": {
747+
"get": {
748+
"consumes": [
749+
"application/json"
750+
],
751+
"produces": [
752+
"audio/x-wav"
753+
],
754+
"summary": "Get TokenMetrics for Active Slot.",
755+
"responses": {
756+
"200": {
757+
"description": "generated audio/wav file",
758+
"schema": {
759+
"type": "string"
760+
}
761+
}
762+
}
763+
}
764+
},
765+
"/v1/tokenize": {
766+
"post": {
767+
"summary": "Tokenize the input.",
768+
"responses": {
769+
"200": {
770+
"description": "Response",
771+
"schema": {
772+
"$ref": "#/definitions/schema.TokenizeResponse"
773+
}
774+
}
775+
}
776+
}
726777
}
727778
},
728779
"definitions": {
@@ -972,14 +1023,6 @@ const docTemplate = `{
9721023
}
9731024
}
9741025
},
975-
"model.Model": {
976-
"type": "object",
977-
"properties": {
978-
"id": {
979-
"type": "string"
980-
}
981-
}
982-
},
9831026
"openai.Assistant": {
9841027
"type": "object",
9851028
"properties": {
@@ -1682,6 +1725,14 @@ const docTemplate = `{
16821725
}
16831726
}
16841727
},
1728+
"schema.SysInfoModel": {
1729+
"type": "object",
1730+
"properties": {
1731+
"id": {
1732+
"type": "string"
1733+
}
1734+
}
1735+
},
16851736
"schema.SystemInformationResponse": {
16861737
"type": "object",
16871738
"properties": {
@@ -1694,7 +1745,7 @@ const docTemplate = `{
16941745
"loaded_models": {
16951746
"type": "array",
16961747
"items": {
1697-
"$ref": "#/definitions/model.Model"
1748+
"$ref": "#/definitions/schema.SysInfoModel"
16981749
}
16991750
}
17001751
}
@@ -1718,14 +1769,25 @@ const docTemplate = `{
17181769
"description": "model name or full path",
17191770
"type": "string"
17201771
},
1721-
"voice": {
1722-
"description": "voice audio file or speaker id",
1772+
"response_format": {
1773+
"description": "(optional) output format",
17231774
"type": "string"
17241775
},
1725-
"response_format": {
1726-
"description": "(optional) output format of generated audio file, defaults to wav, accept wav, mp3, flac, aac, opus",
1776+
"voice": {
1777+
"description": "voice audio file or speaker id",
17271778
"type": "string"
1728-
},
1779+
}
1780+
}
1781+
},
1782+
"schema.TokenizeResponse": {
1783+
"type": "object",
1784+
"properties": {
1785+
"tokens": {
1786+
"type": "array",
1787+
"items": {
1788+
"type": "integer"
1789+
}
1790+
}
17291791
}
17301792
},
17311793
"schema.ToolCall": {

swagger/swagger.json

Lines changed: 76 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,25 @@
272272
}
273273
}
274274
},
275+
"/tokenMetrics": {
276+
"get": {
277+
"consumes": [
278+
"application/json"
279+
],
280+
"produces": [
281+
"audio/x-wav"
282+
],
283+
"summary": "Get TokenMetrics for Active Slot.",
284+
"responses": {
285+
"200": {
286+
"description": "generated audio/wav file",
287+
"schema": {
288+
"type": "string"
289+
}
290+
}
291+
}
292+
}
293+
},
275294
"/tts": {
276295
"post": {
277296
"consumes": [
@@ -716,6 +735,38 @@
716735
}
717736
}
718737
}
738+
},
739+
"/v1/tokenMetrics": {
740+
"get": {
741+
"consumes": [
742+
"application/json"
743+
],
744+
"produces": [
745+
"audio/x-wav"
746+
],
747+
"summary": "Get TokenMetrics for Active Slot.",
748+
"responses": {
749+
"200": {
750+
"description": "generated audio/wav file",
751+
"schema": {
752+
"type": "string"
753+
}
754+
}
755+
}
756+
}
757+
},
758+
"/v1/tokenize": {
759+
"post": {
760+
"summary": "Tokenize the input.",
761+
"responses": {
762+
"200": {
763+
"description": "Response",
764+
"schema": {
765+
"$ref": "#/definitions/schema.TokenizeResponse"
766+
}
767+
}
768+
}
769+
}
719770
}
720771
},
721772
"definitions": {
@@ -965,14 +1016,6 @@
9651016
}
9661017
}
9671018
},
968-
"model.Model": {
969-
"type": "object",
970-
"properties": {
971-
"id": {
972-
"type": "string"
973-
}
974-
}
975-
},
9761019
"openai.Assistant": {
9771020
"type": "object",
9781021
"properties": {
@@ -1675,6 +1718,14 @@
16751718
}
16761719
}
16771720
},
1721+
"schema.SysInfoModel": {
1722+
"type": "object",
1723+
"properties": {
1724+
"id": {
1725+
"type": "string"
1726+
}
1727+
}
1728+
},
16781729
"schema.SystemInformationResponse": {
16791730
"type": "object",
16801731
"properties": {
@@ -1687,7 +1738,7 @@
16871738
"loaded_models": {
16881739
"type": "array",
16891740
"items": {
1690-
"$ref": "#/definitions/model.Model"
1741+
"$ref": "#/definitions/schema.SysInfoModel"
16911742
}
16921743
}
16931744
}
@@ -1711,16 +1762,27 @@
17111762
"description": "model name or full path",
17121763
"type": "string"
17131764
},
1714-
"voice": {
1715-
"description": "voice audio file or speaker id",
1765+
"response_format": {
1766+
"description": "(optional) output format",
17161767
"type": "string"
17171768
},
1718-
"response_format": {
1719-
"description": "(optional) output format of generated audio file, defaults to wav, accept wav, mp3, flac, aac, opus",
1769+
"voice": {
1770+
"description": "voice audio file or speaker id",
17201771
"type": "string"
17211772
}
17221773
}
17231774
},
1775+
"schema.TokenizeResponse": {
1776+
"type": "object",
1777+
"properties": {
1778+
"tokens": {
1779+
"type": "array",
1780+
"items": {
1781+
"type": "integer"
1782+
}
1783+
}
1784+
}
1785+
},
17241786
"schema.ToolCall": {
17251787
"type": "object",
17261788
"properties": {
@@ -1746,4 +1808,4 @@
17461808
"in": "header"
17471809
}
17481810
}
1749-
}
1811+
}

swagger/swagger.yaml

Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,6 @@ definitions:
168168
type: string
169169
type: array
170170
type: object
171-
model.Model:
172-
properties:
173-
id:
174-
type: string
175-
type: object
176171
openai.Assistant:
177172
properties:
178173
created:
@@ -651,6 +646,11 @@ definitions:
651646
$ref: '#/definitions/p2p.NodeData'
652647
type: array
653648
type: object
649+
schema.SysInfoModel:
650+
properties:
651+
id:
652+
type: string
653+
type: object
654654
schema.SystemInformationResponse:
655655
properties:
656656
backends:
@@ -659,7 +659,7 @@ definitions:
659659
type: array
660660
loaded_models:
661661
items:
662-
$ref: '#/definitions/model.Model'
662+
$ref: '#/definitions/schema.SysInfoModel'
663663
type: array
664664
type: object
665665
schema.TTSRequest:
@@ -676,12 +676,19 @@ definitions:
676676
model:
677677
description: model name or full path
678678
type: string
679+
response_format:
680+
description: (optional) output format
681+
type: string
679682
voice:
680683
description: voice audio file or speaker id
681684
type: string
682-
response_format:
683-
description: (optional) output format of generated audio file, defaults to wav, accept wav, mp3, flac, aac, opus
684-
type: string
685+
type: object
686+
schema.TokenizeResponse:
687+
properties:
688+
tokens:
689+
items:
690+
type: integer
691+
type: array
685692
type: object
686693
schema.ToolCall:
687694
properties:
@@ -867,6 +874,18 @@ paths:
867874
schema:
868875
$ref: '#/definitions/schema.SystemInformationResponse'
869876
summary: Show the LocalAI instance information
877+
/tokenMetrics:
878+
get:
879+
consumes:
880+
- application/json
881+
produces:
882+
- audio/x-wav
883+
responses:
884+
"200":
885+
description: generated audio/wav file
886+
schema:
887+
type: string
888+
summary: Get TokenMetrics for Active Slot.
870889
/tts:
871890
post:
872891
consumes:
@@ -1149,6 +1168,26 @@ paths:
11491168
schema:
11501169
type: string
11511170
summary: Generates audio from the input text.
1171+
/v1/tokenMetrics:
1172+
get:
1173+
consumes:
1174+
- application/json
1175+
produces:
1176+
- audio/x-wav
1177+
responses:
1178+
"200":
1179+
description: generated audio/wav file
1180+
schema:
1181+
type: string
1182+
summary: Get TokenMetrics for Active Slot.
1183+
/v1/tokenize:
1184+
post:
1185+
responses:
1186+
"200":
1187+
description: Response
1188+
schema:
1189+
$ref: '#/definitions/schema.TokenizeResponse'
1190+
summary: Tokenize the input.
11521191
securityDefinitions:
11531192
BearerAuth:
11541193
in: header

0 commit comments

Comments
 (0)