Use the Type field to determine which variant is active, then access the corresponding field:
switch format.Type { case components.FormatTypeTextValue: // format.FormatText is populated case components.FormatTypeGrammarValue: // format.FormatGrammar is populated default: // Unknown type - use format.GetUnknownRaw() for raw JSON}
⌘I
Assistant
Responses are generated using AI and may contain mistakes.