sarvamai-go SDK Documentation
Document Intelligence

Initialize

`DocumentIntelligence.Initialize` creates a document-processing job.

Signature

func (c *DocIntelClient) Initialize(ctx context.Context, options ...docIntelOption) (*DocIntelInitializeResponse, error)

Options

OptionTypeValidation
WithLanguagelanguages.Codemust be in languages.AllowedDocIntelLanguages
WithOutputFormathtml|md|jsonstrict enum
WithCallback(url string, authToken *string)URL must be valid HTTPS

Valid / invalid combinations

CombinationResult
WithCallback("https://example.com/cb", nil)Valid
WithCallback("http://example.com/cb", nil)Validation error
WithCallback("not-a-url", nil)Validation error

Validation rules

  1. language is optional, but when set must be supported.
  2. output format is optional, but when set must be one of html, md, json.
  3. callback URL must be valid and use https.

Response highlights

FieldType
JobIDstring
StorageContainerTypeContainerType
JobParametersJobParameters
JobStateJobState

Next step

Call GetUploadLinks.

On this page