sarvamai-go SDK Documentation
Speech-to-Text

Job GetUploadLinks

`SpeechToTextJob.GetUploadLinks` generates presigned upload URLs.

Package

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

Signature

func (c *SttJobClient) GetUploadLinks(ctx context.Context, jobID string, files []string) (*GetUploadLinksResponse, error)

Required fields

  • jobID must be non-empty
  • files must contain at least one file name

Validation

InputResult
valid jobID + non-empty filesValid
empty jobIDValidation error
empty filesValidation error

Response highlights

FieldTypeNotes
JobIdstringSame job ID provided in request.
JobStatespeech.JobStateCurrent job state.
UploadUrlsmap[string]UploadUrlPer-file presigned upload URL map.
StorageContainerTypespeech.ContainerTypeBacking storage type.

Example

resp, err := client.SpeechToTextJob.GetUploadLinks(
    ctx,
    jobID,
    []string{"sample-1.wav", "sample-2.wav"},
)
if err != nil {
    panic(err)
}

for fileName, v := range resp.UploadUrls {
    fmt.Println(fileName, v.FileUrl)
}

Next step

Upload your audio files to returned URLs, then call Start.

On this page