ChatToolChoice - Go SDK

ChatToolChoice type definition

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

Tool choice configuration

Supported Types

ChatToolChoiceNone

1chatToolChoice := components.CreateChatToolChoiceChatToolChoiceNone(components.ChatToolChoiceNone{/* values here */})

ChatToolChoiceAuto

1chatToolChoice := components.CreateChatToolChoiceChatToolChoiceAuto(components.ChatToolChoiceAuto{/* values here */})

ChatToolChoiceRequired

1chatToolChoice := components.CreateChatToolChoiceChatToolChoiceRequired(components.ChatToolChoiceRequired{/* values here */})

ChatNamedToolChoice

1chatToolChoice := components.CreateChatToolChoiceChatNamedToolChoice(components.ChatNamedToolChoice{/* values here */})

Union Discrimination

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

1switch chatToolChoice.Type {
2 case components.ChatToolChoiceTypeChatToolChoiceNone:
3 // chatToolChoice.ChatToolChoiceNone is populated
4 case components.ChatToolChoiceTypeChatToolChoiceAuto:
5 // chatToolChoice.ChatToolChoiceAuto is populated
6 case components.ChatToolChoiceTypeChatToolChoiceRequired:
7 // chatToolChoice.ChatToolChoiceRequired is populated
8 case components.ChatToolChoiceTypeChatNamedToolChoice:
9 // chatToolChoice.ChatNamedToolChoice is populated
10}