Document - Go SDK

Document type definition

The Go SDK and docs are currently in beta. Report issues on GitHub.

A document to rerank. Either a plain string, or a structured object with optional text and/or image.

Supported Types

1document := operations.CreateDocumentStr(string{/* values here */})

DocumentRequest

1document := operations.CreateDocumentDocumentRequest(operations.DocumentRequest{/* values here */})

Union Discrimination

Use the Type field to determine which variant is active, then access the corresponding field:

1switch document.Type {
2 case operations.DocumentTypeStr:
3 // document.Str is populated
4 case operations.DocumentTypeDocumentRequest:
5 // document.DocumentRequest is populated
6}