Use the Type field to determine which variant is active, then access the corresponding field:
switch chatToolChoice.Type { case components.ChatToolChoiceTypeChatToolChoiceNone: // chatToolChoice.ChatToolChoiceNone is populated case components.ChatToolChoiceTypeChatToolChoiceAuto: // chatToolChoice.ChatToolChoiceAuto is populated case components.ChatToolChoiceTypeChatToolChoiceRequired: // chatToolChoice.ChatToolChoiceRequired is populated case components.ChatToolChoiceTypeChatNamedToolChoice: // chatToolChoice.ChatNamedToolChoice is populated case components.ChatToolChoiceTypeChatServerToolChoice: // chatToolChoice.ChatServerToolChoice is populated}
⌘I
Assistant
Responses are generated using AI and may contain mistakes.