Use the Type field to determine which variant is active, then access the corresponding field:
switch formats.Type { case components.FormatsTypeText: // formats.FormatTextConfig is populated case components.FormatsTypeJSONObject: // formats.FormatJSONObjectConfig is populated case components.FormatsTypeJSONSchema: // formats.FormatJSONSchemaConfig is populated default: // Unknown type - use formats.GetUnknownRaw() for raw JSON}
⌘I
Assistant
Responses are generated using AI and may contain mistakes.