mirror of
https://github.com/BoardWare-Genius/jarvis-models.git
synced 2025-12-13 16:53:24 +00:00
doc: swagger.yml
This commit is contained in:
@ -28,7 +28,7 @@ class AudioToText(Blackbox):
|
||||
return text
|
||||
|
||||
async def fast_api_handler(self, request) -> Response:
|
||||
data = (await request.form()).get("data")
|
||||
data = (await request.form()).get("audio")
|
||||
if data is None:
|
||||
return JSONResponse(content={"error": "data is required"}, status_code=status.HTTP_400_BAD_REQUEST)
|
||||
d = await data.read()
|
||||
|
||||
75
swagger.yml
Normal file
75
swagger.yml
Normal file
@ -0,0 +1,75 @@
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Jarvis models APIs
|
||||
description: |-
|
||||
boardware
|
||||
contact:
|
||||
email: chenyunda218@gmail.com
|
||||
version: 0.0.1
|
||||
servers:
|
||||
- url: http://localhost:8080
|
||||
description: Local server
|
||||
tags:
|
||||
- name: Blackbox
|
||||
paths:
|
||||
/?blackbox={blackbox_name}:
|
||||
post:
|
||||
tags:
|
||||
- Blackbox
|
||||
summary: "Create Blackbox"
|
||||
parameters:
|
||||
- name: blackbox_name
|
||||
in: query
|
||||
required: true
|
||||
schema:
|
||||
$ref: "#/components/schemas/BlackboxName"
|
||||
description: "Blackbox name"
|
||||
requestBody:
|
||||
content:
|
||||
multipart/form-data:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Input"
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Input"
|
||||
responses:
|
||||
"200":
|
||||
description: "Success"
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Result"
|
||||
|
||||
components:
|
||||
schemas:
|
||||
TextToAudioInput:
|
||||
type: object
|
||||
properties:
|
||||
text:
|
||||
type: string
|
||||
description: "Text to convert to audio"
|
||||
AudioToTextInput:
|
||||
type: object
|
||||
properties:
|
||||
audio:
|
||||
type: string
|
||||
format: binary
|
||||
Input:
|
||||
oneOf:
|
||||
- $ref: "#/components/schemas/TextToAudioInput"
|
||||
- $ref: "#/components/schemas/AudioToTextInput"
|
||||
TextResult:
|
||||
type: object
|
||||
properties:
|
||||
text:
|
||||
type: string
|
||||
description: "Result of processing"
|
||||
Result:
|
||||
oneOf:
|
||||
- $ref: "#/components/schemas/TextResult"
|
||||
BlackboxName:
|
||||
type: string
|
||||
description: "Blackbox name"
|
||||
enum:
|
||||
- "text_to_audio"
|
||||
- "audio_to_text"
|
||||
Reference in New Issue
Block a user