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
jobIDmust be non-emptyfilesmust contain at least one file name
Validation
| Input | Result |
|---|---|
valid jobID + non-empty files | Valid |
empty jobID | Validation error |
empty files | Validation error |
Response highlights
| Field | Type | Notes |
|---|---|---|
JobId | string | Same job ID provided in request. |
JobState | speech.JobState | Current job state. |
UploadUrls | map[string]UploadUrl | Per-file presigned upload URL map. |
StorageContainerType | speech.ContainerType | Backing 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.