Skip to main content
The Go SDK and docs are currently in beta. Report issues on GitHub.

Supported Types

FileCitation

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

URLCitation

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

FilePath

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

Union Discrimination

Use the Type field to determine which variant is active, then access the corresponding field:
switch openAIResponsesAnnotation.Type {
	case components.OpenAIResponsesAnnotationTypeFileCitation:
		// openAIResponsesAnnotation.FileCitation is populated
	case components.OpenAIResponsesAnnotationTypeURLCitation:
		// openAIResponsesAnnotation.URLCitation is populated
	case components.OpenAIResponsesAnnotationTypeFilePath:
		// openAIResponsesAnnotation.FilePath is populated
	default:
		// Unknown type - use openAIResponsesAnnotation.GetUnknownRaw() for raw JSON
}