Use the Type field to determine which variant is active, then access the corresponding field:
switch allowedToolsUnion.Type { case components.AllowedToolsUnionTypeArrayOfStr: // allowedToolsUnion.ArrayOfStr is populated case components.AllowedToolsUnionTypeAllowedTools: // allowedToolsUnion.AllowedTools is populated case components.AllowedToolsUnionTypeAny: // allowedToolsUnion.Any is populated}
⌘I
Assistant
Responses are generated using AI and may contain mistakes.