speechmatics / speechmatics-js-sdk

Javascript and Typescript SDK for Speechmatics
MIT License
39 stars 4 forks source link

fetch_data to submit a batch job via URL not working #49

Closed nickgerig closed 1 day ago

nickgerig commented 2 weeks ago

Describe the bug Calling fetch_data as per the specification does not work in the JS SDK.

To Reproduce Steps to reproduce the behavior:

  .transcribe({
    fetch_data: { url: '<url>` },
    transcription_config: { language: 'en' },
  })
  .then(({ results }) => {
    console.log(results.map((r) => r.alternatives[0].content).join(' '));
  })
  .catch((error) => {
    console.log(error);
    process.exit(1);
  });
nickgerig commented 2 weeks ago

This will be fixed shortly with an upcoming major release. In the meantime please use this workaround:

sm.batch.transcribe({
  input: {
    fetch: {
      url: '<url>',
    },
  },
});
erkkimon commented 2 weeks ago

Thank you. Any guess when the next release is coming up? Are we talking about days or weeks?

nickgerig commented 2 weeks ago

We plan to do it next week

nickgerig commented 2 weeks ago

I'll close this bug once it's released so you should get notified.

erkkimon commented 2 weeks ago

I appreciate it, cheers @nickgerig!

mnemitz commented 2 weeks ago

Hi @erkkimon, we've just released version 4.0.0 of the SDK in which we've changed the function signature for transcribe(...) to more clearly distinguish between the URL and File cases. See the release notes here: https://github.com/speechmatics/speechmatics-js-sdk/releases/tag/v4.0.0

We've also updated the examples and added a new one for URL fetching: https://github.com/speechmatics/speechmatics-js-sdk/blob/main/examples/example_batch_url.js