OpenAIResponsesAnnotation - Go SDK

OpenAIResponsesAnnotation type definition

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

Supported Types

FileCitation

1openAIResponsesAnnotation := components.CreateOpenAIResponsesAnnotationFileCitation(components.FileCitation{/* values here */})

URLCitation

1openAIResponsesAnnotation := components.CreateOpenAIResponsesAnnotationURLCitation(components.URLCitation{/* values here */})

FilePath

1openAIResponsesAnnotation := components.CreateOpenAIResponsesAnnotationFilePath(components.FilePath{/* values here */})

Union Discrimination

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

1switch openAIResponsesAnnotation.Type {
2 case components.OpenAIResponsesAnnotationTypeFileCitation:
3 // openAIResponsesAnnotation.FileCitation is populated
4 case components.OpenAIResponsesAnnotationTypeURLCitation:
5 // openAIResponsesAnnotation.URLCitation is populated
6 case components.OpenAIResponsesAnnotationTypeFilePath:
7 // openAIResponsesAnnotation.FilePath is populated
8 default:
9 // Unknown type - use openAIResponsesAnnotation.GetUnknownRaw() for raw JSON
10}