Type - Go SDK

Type type definition

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

Supported Types

OpenAIResponsesToolChoiceTypeWebSearchPreview20250311

1type := components.CreateTypeOpenAIResponsesToolChoiceTypeWebSearchPreview20250311(components.OpenAIResponsesToolChoiceTypeWebSearchPreview20250311{/* values here */})

OpenAIResponsesToolChoiceTypeWebSearchPreview

1type := components.CreateTypeOpenAIResponsesToolChoiceTypeWebSearchPreview(components.OpenAIResponsesToolChoiceTypeWebSearchPreview{/* values here */})

Union Discrimination

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

1switch type.Type {
2 case components.TypeTypeOpenAIResponsesToolChoiceTypeWebSearchPreview20250311:
3 // type.OpenAIResponsesToolChoiceTypeWebSearchPreview20250311 is populated
4 case components.TypeTypeOpenAIResponsesToolChoiceTypeWebSearchPreview:
5 // type.OpenAIResponsesToolChoiceTypeWebSearchPreview is populated
6}