Use the Type field to determine which variant is active, then access the corresponding field:
switch functionCallOutputItemOutputUnion2.Type { case components.FunctionCallOutputItemOutputUnion2TypeStr: // functionCallOutputItemOutputUnion2.Str is populated case components.FunctionCallOutputItemOutputUnion2TypeArrayOfFunctionCallOutputItemOutputUnion1: // functionCallOutputItemOutputUnion2.ArrayOfFunctionCallOutputItemOutputUnion1 is populated}
⌘I
Assistant
Responses are generated using AI and may contain mistakes.