docs(api): update API documentation in swagger.yaml

This commit includes updates to the `swagger.yaml` file to reflect the latest
documentation for the API. It provides more accurate and up-to-date information
about the available endpoints and their usage.

BREAKING CHANGE: None
master
adriano 2023-11-03 11:42:13 -03:00
parent 5673c86505
commit 3ad4838574
5 changed files with 343 additions and 25 deletions

Binary file not shown.

Binary file not shown.

View File

@ -5,9 +5,9 @@ const { audioUpload } = require("../utils")
const { getSentiment, getAudioFromText, getTextFromAudio, getVoiceConfig, uploadAudioToTranscript, getJobStatus } = require('../controllers/naturalLanguageController')
router.route('/sentiment').post(authorization, getSentiment)
router.route('/text-to-speech').get(getAudioFromText)
router.route('/speech-to-text').post(audioUpload.single('audio'), getTextFromAudio)
router.route('/upload-audio-to-transcript').post(audioUpload.single('audio'), uploadAudioToTranscript)
router.route('/text-to-speech').get(authorization, getAudioFromText)
router.route('/speech-to-text').post(audioUpload.single('audio'), authorization, getTextFromAudio)
router.route('/upload-audio-to-transcript').post(audioUpload.single('audio'), authorization, uploadAudioToTranscript)
router.route('/query-job-status').get(getJobStatus)
router.route('/voice-config').get(getVoiceConfig)

View File

@ -1,30 +1,117 @@
openapi: 3.0.0
info:
title: Natural Language API
title: Natural Language API Google
description: This API describes the endpoints and parameters to use resources from Google Cloud API.
contact: {}
description: This API describes the endpoints and parameters to use resources from google cloud api.
version: '1.0'
servers:
- url: http://localhost:6001/api/v1/nl/
- url: http://localhost:6001/api/v1/nl
variables: {}
paths:
/upload-audio-to-transcript:
post:
tags:
- Speech to text async
summary: Speech to text job
operationId: Speechtotextjob
parameters: []
requestBody:
content:
multipart/form-data:
encoding: {}
schema:
required:
- audio
type: object
properties:
audio:
type: string
format: binary
languageCode:
type: string
description: 'If not provided, the default will be: pt-BR'
example: pt-BR
required: false
responses:
'200':
description: ''
headers: {}
deprecated: false
security:
- bearer: []
/query-job-status:
get:
tags:
- Speech to text async
summary: Speech to text job process
operationId: Speechtotextjobprocess
parameters:
- name: operationName
in: query
description: 'The job id returned after uploading the audio file that will be transcribed.'
required: true
style: form
explode: true
schema:
type: integer
format: int64
example: 2993135803178989324
responses:
'200':
description: ''
headers: {}
deprecated: false
security:
- bearer: []
/speech-to-text:
post:
tags:
- Speech to text sync
summary: Speech to text
operationId: Speechtotext
parameters: []
requestBody:
content:
multipart/form-data:
encoding: {}
schema:
required:
- audio
type: object
properties:
audio:
type: string
format: binary
languageCode:
description: 'If not provided, the default will be: pt-BR'
type: string
example: pt-BR
required: false
responses:
'200':
description: ''
headers: {}
deprecated: false
security:
- bearer: []
/sentiment:
post:
tags:
- API ROUTES
- Sentiment
summary: Get sentiment
operationId: Getsentiment
parameters: []
requestBody:
description: 'The text that will be analyzed'
description: ''
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/GetsentimentRequest'
- example:
text: Vcs vao fica enrolando ate quando pra entregar isso!
text: Toda vez a mesma coisa ja to cansado de ficar ligando pra resolver esses problemas de conexão!
example:
text: Vcs vao fica enrolando ate quando pra entregar isso!
text: Toda vez a mesma coisa ja to cansado de ficar ligando pra resolver esses problemas de conexão!
required: true
responses:
'200':
@ -36,13 +123,13 @@ paths:
/text-to-speech:
get:
tags:
- API ROUTES
- Text to speech
summary: Text to speech
operationId: Texttospeech
parameters:
- name: text
in: query
description: 'The text that will be converted to audio'
description: ''
required: true
style: form
explode: true
@ -51,31 +138,31 @@ paths:
example: Vela branca na enxurrada la vou eu de léo em léo, se o navio é pequeno do tamanho de um chapeu, não importa a volta ao mundo, é viagem de brinquedo em um barquinho de papel.
- name: voice_name
in: query
description: 'The name of the voice. Ex: pt-BR-Wavenet-C'
description: ''
required: false
style: form
explode: true
schema:
type: string
example:
example: pt-BR-Wavenet-C
- name: voice_gender
in: query
description: 'The name of the voice. Ex: FEMALE'
description: ''
required: false
style: form
explode: true
schema:
type: string
example:
example: FEMALE
- name: languageCode
in: query
description: 'Ex pt-BR'
description: ''
required: false
style: form
explode: true
schema:
type: string
example:
example: pt-BR
responses:
'200':
description: ''
@ -86,13 +173,13 @@ paths:
/voice-config:
get:
tags:
- API ROUTES
- Text to speech
summary: Get voice config
operationId: Getvoiceconfig
parameters:
- name: languageCode
in: query
description: 'Ex pt-BR'
description: ''
required: false
style: form
explode: true
@ -104,11 +191,26 @@ paths:
description: ''
headers: {}
deprecated: false
security:
- bearer: []
security: []
components:
schemas:
GetsentimentRequest:
title: GetsentimentRequest
required:
- text
type: object
properties:
text:
type: string
example:
text: Toda vez a mesma coisa ja to cansado de ficar ligando pra resolver esses problemas de conexão!
securitySchemes:
bearer:
type: http
scheme: bearer
security: []
tags:
- name: Speech to text async
- name: Speech to text sync
- name: Sentiment
- name: Text to speech

View File

@ -0,0 +1,216 @@
openapi: 3.0.0
info:
title: Natural Language API Google
description: This API describes the endpoints and parameters to use resources from Google Cloud API.
contact: {}
version: '1.0'
servers:
- url: https://hit-nl.omnihit.app.br/api/v1/nl
variables: {}
paths:
/upload-audio-to-transcript:
post:
tags:
- Speech to text async
summary: Speech to text job
operationId: Speechtotextjob
parameters: []
requestBody:
content:
multipart/form-data:
encoding: {}
schema:
required:
- audio
type: object
properties:
audio:
type: string
format: binary
languageCode:
type: string
description: 'If not provided, the default will be: pt-BR'
example: pt-BR
required: false
responses:
'200':
description: ''
headers: {}
deprecated: false
security:
- bearer: []
/query-job-status:
get:
tags:
- Speech to text async
summary: Speech to text job process
operationId: Speechtotextjobprocess
parameters:
- name: operationName
in: query
description: 'The job id returned after uploading the audio file that will be transcribed.'
required: true
style: form
explode: true
schema:
type: integer
format: int64
example: 2993135803178989324
responses:
'200':
description: ''
headers: {}
deprecated: false
security:
- bearer: []
/speech-to-text:
post:
tags:
- Speech to text sync
summary: Speech to text
operationId: Speechtotext
parameters: []
requestBody:
content:
multipart/form-data:
encoding: {}
schema:
required:
- audio
type: object
properties:
audio:
type: string
format: binary
languageCode:
description: 'If not provided, the default will be: pt-BR'
type: string
example: pt-BR
required: false
responses:
'200':
description: ''
headers: {}
deprecated: false
security:
- bearer: []
/sentiment:
post:
tags:
- Sentiment
summary: Get sentiment
operationId: Getsentiment
parameters: []
requestBody:
description: ''
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/GetsentimentRequest'
- example:
text: Toda vez a mesma coisa ja to cansado de ficar ligando pra resolver esses problemas de conexão!
example:
text: Toda vez a mesma coisa ja to cansado de ficar ligando pra resolver esses problemas de conexão!
required: true
responses:
'200':
description: ''
headers: {}
deprecated: false
security:
- bearer: []
/text-to-speech:
get:
tags:
- Text to speech
summary: Text to speech
operationId: Texttospeech
parameters:
- name: text
in: query
description: ''
required: true
style: form
explode: true
schema:
type: string
example: Vela branca na enxurrada la vou eu de léo em léo, se o navio é pequeno do tamanho de um chapeu, não importa a volta ao mundo, é viagem de brinquedo em um barquinho de papel.
- name: voice_name
in: query
description: ''
required: false
style: form
explode: true
schema:
type: string
example: pt-BR-Wavenet-C
- name: voice_gender
in: query
description: ''
required: false
style: form
explode: true
schema:
type: string
example: FEMALE
- name: languageCode
in: query
description: ''
required: false
style: form
explode: true
schema:
type: string
example: pt-BR
responses:
'200':
description: ''
headers: {}
deprecated: false
security:
- bearer: []
/voice-config:
get:
tags:
- Text to speech
summary: Get voice config
operationId: Getvoiceconfig
parameters:
- name: languageCode
in: query
description: ''
required: false
style: form
explode: true
schema:
type: string
example: pt-Br
responses:
'200':
description: ''
headers: {}
deprecated: false
security: []
components:
schemas:
GetsentimentRequest:
title: GetsentimentRequest
required:
- text
type: object
properties:
text:
type: string
example:
text: Toda vez a mesma coisa ja to cansado de ficar ligando pra resolver esses problemas de conexão!
securitySchemes:
bearer:
type: http
scheme: bearer
security: []
tags:
- name: Speech to text async
- name: Speech to text sync
- name: Sentiment
- name: Text to speech