Skip to content

Commit

Permalink
fix(speech-to-text): support all allowed parameters in WebSocket method
Browse files Browse the repository at this point in the history
  • Loading branch information
dpopp07 committed Jul 17, 2019
1 parent 9696f62 commit b91c1e2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/recognize-stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ import websocket = require ('websocket');
const w3cWebSocket = websocket.w3cwebsocket;

const OPENING_MESSAGE_PARAMS_ALLOWED = [
'action',
'customization_weight',
'processing_metrics',
'processing_metrics_interval',
'audio_metrics',
'inactivity_timeout',
'timestamps',
'word_confidence',
Expand All @@ -37,7 +42,7 @@ const OPENING_MESSAGE_PARAMS_ALLOWED = [
'smart_formatting',
'speaker_labels',
'grammar_name',
'redaction'
'redaction',
];

const QUERY_PARAMS_ALLOWED = [
Expand All @@ -48,9 +53,8 @@ const QUERY_PARAMS_ALLOWED = [
'customization_id',
'acoustic_customization_id',
'access_token',
'processing_metrics',
'processing_metrics_interval',
'audio_metrics'
'base_model_version',
'x-watson-metadata',
];

interface RecognizeStream extends Duplex {
Expand Down

0 comments on commit b91c1e2

Please sign in to comment.