Use the Type field to determine which variant is active, then access the corresponding field:
switch toolChoice.Type { case components.ToolChoiceTypeAutoValue: // toolChoice.ToolChoiceAuto is populated case components.ToolChoiceTypeAny: // toolChoice.ToolChoiceAny is populated case components.ToolChoiceTypeNone: // toolChoice.ToolChoiceNone is populated case components.ToolChoiceTypeTool: // toolChoice.ToolChoiceTool is populated}
⌘I
Assistant
Responses are generated using AI and may contain mistakes.