Skip to main content
The Go SDK and docs are currently in beta. Report issues on GitHub.

Supported Types

FormatText

format := components.CreateFormatText(components.FormatText{/* values here */})

FormatGrammar

format := components.CreateFormatGrammar(components.FormatGrammar{/* values here */})

Union Discrimination

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
}