Skip to content

REVAI-4573: Update SDKs to support new model#384

Open
Greyvend wants to merge 4 commits intodevelopfrom
feature/REVAI-4573-source-config-migration
Open

REVAI-4573: Update SDKs to support new model#384
Greyvend wants to merge 4 commits intodevelopfrom
feature/REVAI-4573-source-config-migration

Conversation

@Greyvend
Copy link

@Greyvend Greyvend commented Feb 18, 2026

Description of Work

Migrates submitJobUrl from sending media_url to source_config, enabling support for the machine_v3 transcriber.

What Changed

  • src/api-client.ts: submitJobUrl now builds source_config: { url: mediaUrl } instead of media_url: mediaUrl. Added validation that throws if the caller also passes source_config in options (conflicting with the mediaUrl parameter).
  • test/unit/api-client/api-client.submit.spec.ts: Updated all existing submitJobUrl assertions from media_url to source_config. Added 2 new tests: one verifying the source_config payload shape, one verifying the conflict error.
  • test/integration/test/job-v3.test.js: New integration test that submits a job via submitJobUrl with transcriber: 'machine_v3' and verifies success.

Screenshots

Test script (examples/submit_job_url_v3.js)

require('dotenv').config();

const revai = require('../dist/src');

const token = process.env.API_KEY;
const baseUrl = process.env.BASE_URL;

(async () => {
    var client = new revai.RevAiApiClient({ token });

    if (baseUrl) {
        client.apiHandler.instance.defaults.baseURL = `${baseUrl}/speechtotext/v1/`;
    }

    // Submit a job using submitJobUrl with machine_v3 transcriber
    console.log('Submitting job with submitJobUrl and machine_v3 transcriber...');
    var job = await client.submitJobUrl('https://www.rev.ai/FTC_Sample_1.mp3', {
        transcriber: 'machine_v3',
        metadata: 'Node SDK submitJobUrl v3 test'
    });

    console.log(`Job Id: ${job.id}`);
    console.log(`Status: ${job.status}`);
    console.log(`Created On: ${job.created_on}`);

    // Poll until complete
    var jobStatus;
    while ((jobStatus = (await client.getJobDetails(job.id)).status) === revai.JobStatus.InProgress) {
        console.log(`Job ${job.id} is ${jobStatus}, waiting...`);
        await new Promise(resolve => setTimeout(resolve, 5000));
    }

    console.log(`Job ${job.id} final status: ${jobStatus}`);

    if (jobStatus === revai.JobStatus.Transcribed) {
        var transcript = await client.getTranscriptText(job.id);
        console.log('\n--- Transcript (first 500 chars) ---');
        console.log(transcript.substring(0, 500));
    } else {
        console.log('Job did not complete successfully.');
        var details = await client.getJobDetails(job.id);
        console.log('Job details:', JSON.stringify(details, null, 2));
    }
})();

Output (local API)

Submitting job with submitJobUrl and machine_v3 transcriber...
Job Id: T8c2aaJXoJHP
Status: in_progress
Created On: 2026-02-18T16:53:52.855Z
Job T8c2aaJXoJHP is in_progress, waiting...

Job was accepted by the API (no 400 error) and is processing. Previously this would fail with media_url is not supported for machine_v3 transcriber. Use source_config instead.

Questions

  • submitJobUrl is marked @deprecated (predating this PR) with the message "Use submitJob and provide a source config to the job options." Now that submitJobUrl internally uses source_config, it works correctly with all transcribers including machine_v3. Should we remove submitJobUrl entirely in a future release, or remove the deprecation notice since it now behaves correctly? If we keep the deprecation, what is the concrete condition/timeline for actually removing it?
  • [ ]

Additional Comments

If you have any additional comments or notes for reviewers, please add them here.

Greyvend and others added 3 commits February 18, 2026 14:10
This test currently fails with 400 because submitJobUrl sends media_url
which is not supported by the v3 transcriber. It will pass once we
migrate to source_config.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Two failing tests:
- submitJobUrl should send source_config instead of media_url
- submitJobUrl should throw when options contain source_config

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- submitJobUrl now sends source_config: { url: mediaUrl } instead of
  media_url, enabling support for the machine_v3 transcriber
- Add validation: throw error if options already contain source_config
- Update existing unit test assertions accordingly

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Greyvend Greyvend requested a review from a team as a code owner February 18, 2026 15:29
- Break long error message in submitJobUrl across multiple lines
- Break long assertion string in unit test
- Replace fake URL with existing mediaUrl constant to avoid linkChecker
  DNS resolution failure

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Greyvend Greyvend requested a review from dmtrrk February 18, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments