Skip to content

feat(swagger): update swagger #4155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 76 additions & 14 deletions swagger/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,25 @@ const docTemplate = `{
}
}
},
"/tokenMetrics": {
"get": {
"consumes": [
"application/json"
],
"produces": [
"audio/x-wav"
],
"summary": "Get TokenMetrics for Active Slot.",
"responses": {
"200": {
"description": "generated audio/wav file",
"schema": {
"type": "string"
}
}
}
}
},
"/tts": {
"post": {
"consumes": [
Expand Down Expand Up @@ -723,6 +742,38 @@ const docTemplate = `{
}
}
}
},
"/v1/tokenMetrics": {
"get": {
"consumes": [
"application/json"
],
"produces": [
"audio/x-wav"
],
"summary": "Get TokenMetrics for Active Slot.",
"responses": {
"200": {
"description": "generated audio/wav file",
"schema": {
"type": "string"
}
}
}
}
},
"/v1/tokenize": {
"post": {
"summary": "Tokenize the input.",
"responses": {
"200": {
"description": "Response",
"schema": {
"$ref": "#/definitions/schema.TokenizeResponse"
}
}
}
}
}
},
"definitions": {
Expand Down Expand Up @@ -972,14 +1023,6 @@ const docTemplate = `{
}
}
},
"model.Model": {
"type": "object",
"properties": {
"id": {
"type": "string"
}
}
},
"openai.Assistant": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1682,6 +1725,14 @@ const docTemplate = `{
}
}
},
"schema.SysInfoModel": {
"type": "object",
"properties": {
"id": {
"type": "string"
}
}
},
"schema.SystemInformationResponse": {
"type": "object",
"properties": {
Expand All @@ -1694,7 +1745,7 @@ const docTemplate = `{
"loaded_models": {
"type": "array",
"items": {
"$ref": "#/definitions/model.Model"
"$ref": "#/definitions/schema.SysInfoModel"
}
}
}
Expand All @@ -1718,14 +1769,25 @@ const docTemplate = `{
"description": "model name or full path",
"type": "string"
},
"voice": {
"description": "voice audio file or speaker id",
"response_format": {
"description": "(optional) output format",
"type": "string"
},
"response_format": {
"description": "(optional) output format of generated audio file, defaults to wav, accept wav, mp3, flac, aac, opus",
"voice": {
"description": "voice audio file or speaker id",
"type": "string"
},
}
}
},
"schema.TokenizeResponse": {
"type": "object",
"properties": {
"tokens": {
"type": "array",
"items": {
"type": "integer"
}
}
}
},
"schema.ToolCall": {
Expand Down
90 changes: 76 additions & 14 deletions swagger/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,25 @@
}
}
},
"/tokenMetrics": {
"get": {
"consumes": [
"application/json"
],
"produces": [
"audio/x-wav"
],
"summary": "Get TokenMetrics for Active Slot.",
"responses": {
"200": {
"description": "generated audio/wav file",
"schema": {
"type": "string"
}
}
}
}
},
"/tts": {
"post": {
"consumes": [
Expand Down Expand Up @@ -716,6 +735,38 @@
}
}
}
},
"/v1/tokenMetrics": {
"get": {
"consumes": [
"application/json"
],
"produces": [
"audio/x-wav"
],
"summary": "Get TokenMetrics for Active Slot.",
"responses": {
"200": {
"description": "generated audio/wav file",
"schema": {
"type": "string"
}
}
}
}
},
"/v1/tokenize": {
"post": {
"summary": "Tokenize the input.",
"responses": {
"200": {
"description": "Response",
"schema": {
"$ref": "#/definitions/schema.TokenizeResponse"
}
}
}
}
}
},
"definitions": {
Expand Down Expand Up @@ -965,14 +1016,6 @@
}
}
},
"model.Model": {
"type": "object",
"properties": {
"id": {
"type": "string"
}
}
},
"openai.Assistant": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1675,6 +1718,14 @@
}
}
},
"schema.SysInfoModel": {
"type": "object",
"properties": {
"id": {
"type": "string"
}
}
},
"schema.SystemInformationResponse": {
"type": "object",
"properties": {
Expand All @@ -1687,7 +1738,7 @@
"loaded_models": {
"type": "array",
"items": {
"$ref": "#/definitions/model.Model"
"$ref": "#/definitions/schema.SysInfoModel"
}
}
}
Expand All @@ -1711,16 +1762,27 @@
"description": "model name or full path",
"type": "string"
},
"voice": {
"description": "voice audio file or speaker id",
"response_format": {
"description": "(optional) output format",
"type": "string"
},
"response_format": {
"description": "(optional) output format of generated audio file, defaults to wav, accept wav, mp3, flac, aac, opus",
"voice": {
"description": "voice audio file or speaker id",
"type": "string"
}
}
},
"schema.TokenizeResponse": {
"type": "object",
"properties": {
"tokens": {
"type": "array",
"items": {
"type": "integer"
}
}
}
},
"schema.ToolCall": {
"type": "object",
"properties": {
Expand All @@ -1746,4 +1808,4 @@
"in": "header"
}
}
}
}
57 changes: 48 additions & 9 deletions swagger/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,6 @@ definitions:
type: string
type: array
type: object
model.Model:
properties:
id:
type: string
type: object
openai.Assistant:
properties:
created:
Expand Down Expand Up @@ -651,6 +646,11 @@ definitions:
$ref: '#/definitions/p2p.NodeData'
type: array
type: object
schema.SysInfoModel:
properties:
id:
type: string
type: object
schema.SystemInformationResponse:
properties:
backends:
Expand All @@ -659,7 +659,7 @@ definitions:
type: array
loaded_models:
items:
$ref: '#/definitions/model.Model'
$ref: '#/definitions/schema.SysInfoModel'
type: array
type: object
schema.TTSRequest:
Expand All @@ -676,12 +676,19 @@ definitions:
model:
description: model name or full path
type: string
response_format:
description: (optional) output format
type: string
voice:
description: voice audio file or speaker id
type: string
response_format:
description: (optional) output format of generated audio file, defaults to wav, accept wav, mp3, flac, aac, opus
type: string
type: object
schema.TokenizeResponse:
properties:
tokens:
items:
type: integer
type: array
type: object
schema.ToolCall:
properties:
Expand Down Expand Up @@ -867,6 +874,18 @@ paths:
schema:
$ref: '#/definitions/schema.SystemInformationResponse'
summary: Show the LocalAI instance information
/tokenMetrics:
get:
consumes:
- application/json
produces:
- audio/x-wav
responses:
"200":
description: generated audio/wav file
schema:
type: string
summary: Get TokenMetrics for Active Slot.
/tts:
post:
consumes:
Expand Down Expand Up @@ -1149,6 +1168,26 @@ paths:
schema:
type: string
summary: Generates audio from the input text.
/v1/tokenMetrics:
get:
consumes:
- application/json
produces:
- audio/x-wav
responses:
"200":
description: generated audio/wav file
schema:
type: string
summary: Get TokenMetrics for Active Slot.
/v1/tokenize:
post:
responses:
"200":
description: Response
schema:
$ref: '#/definitions/schema.TokenizeResponse'
summary: Tokenize the input.
securityDefinitions:
BearerAuth:
in: header
Expand Down