ToolChoice - Go SDK

ToolChoice type definition

The Go SDK and docs are currently in beta. Report issues on GitHub.

Supported Types

ToolChoiceAuto

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

ToolChoiceAny

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

ToolChoiceNone

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

ToolChoiceTool

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

Union Discrimination

Use the Type field to determine which variant is active, then access the corresponding field:

1switch toolChoice.Type {
2 case components.ToolChoiceTypeAutoValue:
3 // toolChoice.ToolChoiceAuto is populated
4 case components.ToolChoiceTypeAny:
5 // toolChoice.ToolChoiceAny is populated
6 case components.ToolChoiceTypeNone:
7 // toolChoice.ToolChoiceNone is populated
8 case components.ToolChoiceTypeTool:
9 // toolChoice.ToolChoiceTool is populated
10}