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

Supported Types

ToolChoiceAuto

toolChoice := components.CreateToolChoiceAuto(components.ToolChoiceAuto{/* values here */})

ToolChoiceAny

toolChoice := components.CreateToolChoiceAny(components.ToolChoiceAny{/* values here */})

ToolChoiceNone

toolChoice := components.CreateToolChoiceNone(components.ToolChoiceNone{/* values here */})

ToolChoiceTool

toolChoice := components.CreateToolChoiceTool(components.ToolChoiceTool{/* values here */})

Union Discrimination

Use the Type field to determine which variant is active, then access the corresponding field:
switch toolChoice.Type {
	case components.ToolChoiceTypeAutoValue:
		// toolChoice.ToolChoiceAuto is populated
	case components.ToolChoiceTypeAny:
		// toolChoice.ToolChoiceAny is populated
	case components.ToolChoiceTypeNone:
		// toolChoice.ToolChoiceNone is populated
	case components.ToolChoiceTypeTool:
		// toolChoice.ToolChoiceTool is populated
}