type := components.CreateTypeOpenAIResponsesToolChoiceTypeWebSearchPreview20250311(components.OpenAIResponsesToolChoiceTypeWebSearchPreview20250311{/* values here */})
type := components.CreateTypeOpenAIResponsesToolChoiceTypeWebSearchPreview(components.OpenAIResponsesToolChoiceTypeWebSearchPreview{/* values here */})
Use the Type field to determine which variant is active, then access the corresponding field:
switch type.Type { case components.TypeTypeOpenAIResponsesToolChoiceTypeWebSearchPreview20250311: // type.OpenAIResponsesToolChoiceTypeWebSearchPreview20250311 is populated case components.TypeTypeOpenAIResponsesToolChoiceTypeWebSearchPreview: // type.OpenAIResponsesToolChoiceTypeWebSearchPreview is populated}
⌘I
Assistant
Responses are generated using AI and may contain mistakes.