Como configurar

A configuração deve ser realizada via API Rest na criação do job (upload do arquivo de mídia).

Por compatibilidade com versões anteriores, existem duas formas de enviar a configuração:

  1. json (preferencial)

Exemplos de chamadas curl:

  • Exemplo para habilitar o detector de DTMF e adicionar palavras no Word Hints:

curl -X POST "http://localhost:8000/trd/v3/job/create" \
 -H "accept: application/json" \
 -H "Authorization: Bearer <token>" \
 -H "Content-Type: multipart/form-data" \
 -F "upload_file=@<file_path>;type=audio/wav" \
 -F 'config={"diarization":{"vad":{"dual_tone":{"enabled": true}}},"recognition":{"hints.words":["mexirica"]}}'
  • Exemplo para habilitar os classificadores de fala e adicionar palavras no Word Hints:

curl -X POST "http://localhost:8000/trd/v3/job/create" \
 -H "accept: application/json" \
 -H "Authorization: Bearer <token>" \
 -H "Content-Type: multipart/form-data" \
 -F "upload_file=@<file_path>;type=audio/wav" \
 -F 'config={"recognition": {"tasks": ["emotion", "age", "gender"],"hints.words": ["mexirica:1.8 [mixirica]", "siciliano:2", "castanha-do-pará"]}}'
  1. string com uma lista de valores:

Na requisição o parâmetro config recebe uma lista de valores de texto, com a configuração.

Exemplos de chamadas curl:

  • Exemplo para habilitar o classificador descritor e adicionar palavras no Word Hints:

curl -X POST "http://localhost:8000/trd/v3/job/create" \
 -H "accept: application/json" \
 -H "Authorization: Bearer <token>" \
 -H "Content-Type: multipart/form-data" \
 -F "upload_file=@<file_path>;type=audio/wav" \
 -F "config=diarization.descriptor.enabled=True" \
 -F "config=recognition.hints.words=mexirica"

ou então:

curl -X POST "http://localhost:8000/trd/v3/job/create" \
 -H "accept: application/json" \
 -H "Authorization: Bearer <token>" \
 -H "Content-Type: multipart/form-data" \
 -F "upload_file=@<file_path>;type=audio/wav" \
 --form-string "config=diarization.descriptor.enabled=True,recognition.hints.words=mexirica"
  • Exemplo para configurar múltiplas callback no webhook:

curl -X POST "http://localhost:8000/trd/v3/job/create" \
 -H "accept: application/json" \
 -H "Authorization: Bearer <token>" \
 -H "Content-Type: multipart/form-data" \
 -F "upload_file=@<file_path>;type=audio/wav" \
 -F "callback_urls=https://172.19.0.9:8443/callback1" \
 -F "callback_urls=https://172.19.0.9:8443/callback2"

ou então:

curl -X POST "http://localhost:8000/trd/v3/job/create" \
 -H "accept: application/json" \
 -H "Authorization: Bearer <token>" \
 -H "Content-Type: multipart/form-data" \
 -F "upload_file=@<file_path>;type=audio/wav" \
 --form-string "callback_urls=https://172.19.0.9:8443/callback1,https://172.19.0.9:8443/callback2"
  • Exemplo para habilitar os classificadores de fala e adicionar word-hints:

curl -X POST "http://localhost:8000/trd/v3/job/create" \
 -H "accept: application/json" \
 -H "Authorization: Bearer <token>" \
 -H "Content-Type: multipart/form-data" \
 -F "upload_file=@<file_path>;type=audio/wav" \
 --form-string "config=recognition.tasks=emotion;age;gender,recognition.hints.words=mexirica:1.8 [mixirica]; siciliano:2; castanha-do-pará"