Content - Go SDK

Content type definition

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

Supported Types

ContentText

1content := operations.CreateContentText(operations.ContentText{/* values here */})

ContentImageURL

1content := operations.CreateContentImageURL(operations.ContentImageURL{/* values here */})

ContentPartInputAudio

1content := operations.CreateContentInputAudio(components.ContentPartInputAudio{/* values here */})

ContentPartInputVideo

1content := operations.CreateContentInputVideo(components.ContentPartInputVideo{/* values here */})

ContentPartInputFile

1content := operations.CreateContentInputFile(components.ContentPartInputFile{/* values here */})

Union Discrimination

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

1switch content.Type {
2 case operations.ContentTypeText:
3 // content.ContentText is populated
4 case operations.ContentTypeImageURL:
5 // content.ContentImageURL is populated
6 case operations.ContentTypeInputAudio:
7 // content.ContentPartInputAudio is populated
8 case operations.ContentTypeInputVideo:
9 // content.ContentPartInputVideo is populated
10 case operations.ContentTypeInputFile:
11 // content.ContentPartInputFile is populated
12}