sarvamai-go SDK Documentation
Speech-to-Text

Job GetStatus

`SpeechToTextJob.GetStatus` checks batch job progress.

Package

import "github.com/Shreehari-Acharya/sarvamai-go/sttjob"

Signature

func (c *SttJobClient) GetStatus(ctx context.Context, jobID string) (*JobTranscribeResponse, error)

Validation

  • jobID must be non-empty

Response highlights

FieldTypeNotes
JobIdstringJob identifier.
JobStatespeech.JobStateAccepted, Pending, Running, Completed, Failed.
TotalFiles*intTotal files in job (may be nil early).
SuccessfulFilesCount*intSuccessful file count.
FailedFilesCount*intFailed file count.
ErrorMessage*stringPopulated on failure.
JobDetails*[]speech.JobDetailPer-file detail records.

Typical polling

for {
    status, err := client.SpeechToTextJob.GetStatus(ctx, jobID)
    if err != nil {
        panic(err)
    }

    if status.JobState == sttjob.JobStateCompleted || status.JobState == sttjob.JobStateFailed {
        break
    }
    time.Sleep(2 * time.Second)
}

The SDK itself does not throttle polling; apply your own interval.

On this page