AnthropicDocumentBlockParamSourceUnion - Go SDK

AnthropicDocumentBlockParamSourceUnion type definition

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

Supported Types

AnthropicBase64PdfSource

1anthropicDocumentBlockParamSourceUnion := components.CreateAnthropicDocumentBlockParamSourceUnionBase64(components.AnthropicBase64PdfSource{/* values here */})

AnthropicPlainTextSource

1anthropicDocumentBlockParamSourceUnion := components.CreateAnthropicDocumentBlockParamSourceUnionText(components.AnthropicPlainTextSource{/* values here */})

SourceContent

1anthropicDocumentBlockParamSourceUnion := components.CreateAnthropicDocumentBlockParamSourceUnionContent(components.SourceContent{/* values here */})

AnthropicURLPdfSource

1anthropicDocumentBlockParamSourceUnion := components.CreateAnthropicDocumentBlockParamSourceUnionURLObj(components.AnthropicURLPdfSource{/* values here */})

Union Discrimination

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

1switch anthropicDocumentBlockParamSourceUnion.Type {
2 case components.AnthropicDocumentBlockParamSourceUnionTypeBase64:
3 // anthropicDocumentBlockParamSourceUnion.AnthropicBase64PdfSource is populated
4 case components.AnthropicDocumentBlockParamSourceUnionTypeText:
5 // anthropicDocumentBlockParamSourceUnion.AnthropicPlainTextSource is populated
6 case components.AnthropicDocumentBlockParamSourceUnionTypeContent:
7 // anthropicDocumentBlockParamSourceUnion.SourceContent is populated
8 case components.AnthropicDocumentBlockParamSourceUnionTypeURLObj:
9 // anthropicDocumentBlockParamSourceUnion.AnthropicURLPdfSource is populated
10}