Skip to content

[speech-to-text] asynchronous creation, can't get recognitions.completed_with_results #415

Description

@micahbrich

Hey there! I seem to have hit some issue in defining asynchronous callback events — the docs mention you can pass an extra query parameter to request the completed callback to include results, but I can't make that happen.

I've got this:

const params = {
    'content_type': 'audio/wav',
    audio: request(`https://${clip.wav}`),
    'callback_url': hostname + '/callback',
    'user_token': clip.id,
    model: 'en-US_NarrowbandModel',
    content_type: 'audio/wav',
    inactivity_timeout: -1,
    interim_results: false,
    max_alternatives: 4,
    word_confidence: true,
    timestamps: true,
    profanity_filter: false,
    smart_formatting: true,
    speaker_labels: true,
    'word_alternatives_threshold':0.5,
    events: "recognitions.started,recognitions.completed_with_results,recognitions.failed",
  };

  Watson.createRecognitionJob(params, function(error, job) {
    if (error)
      console.log('Error:', error);
    else
      console.log(JSON.stringify(job, null, 2));
  });

The callback registration, transcription, and everything else is working great, just not the specified callback events. I get something like the last two events shown here:

screen shot 2017-03-14 at 11 26 33

I tried specifying events in the params as a comma-separated string like the docs suggest & an array of strings (which the source looks like converts to a comma-separated string). I tried events as the key, but also event as a Hail Mary attempt. I tried writing the list as both recognitions.completed_with_results and just completed_with_results, in case it was a misunderstanding.

I can successfully use that recognitions.completed event ID to do a new GET request and get the results, but it's an extra step in a pretty time-sensitive app, so I'm hoping I can get the event & result in one like the docs suggest.

Does anyone have any ideas what's up? Am I missing something, or doing anything wrong? Is this a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions