Supported Types
ChatFunctionToolFunction
chatFunctionTool := components.CreateChatFunctionToolChatFunctionToolFunction(components.ChatFunctionToolFunction{/* values here */})
AdvisorServerToolOpenRouter
chatFunctionTool := components.CreateChatFunctionToolAdvisorServerToolOpenRouter(components.AdvisorServerToolOpenRouter{/* values here */})
BashServerTool
chatFunctionTool := components.CreateChatFunctionToolBashServerTool(components.BashServerTool{/* values here */})
DatetimeServerTool
chatFunctionTool := components.CreateChatFunctionToolDatetimeServerTool(components.DatetimeServerTool{/* values here */})
FilesServerTool
chatFunctionTool := components.CreateChatFunctionToolFilesServerTool(components.FilesServerTool{/* values here */})
FusionServerToolOpenRouter
chatFunctionTool := components.CreateChatFunctionToolFusionServerToolOpenRouter(components.FusionServerToolOpenRouter{/* values here */})
ImageGenerationServerToolOpenRouter
chatFunctionTool := components.CreateChatFunctionToolImageGenerationServerToolOpenRouter(components.ImageGenerationServerToolOpenRouter{/* values here */})
ChatSearchModelsServerTool
chatFunctionTool := components.CreateChatFunctionToolChatSearchModelsServerTool(components.ChatSearchModelsServerTool{/* values here */})
SubagentServerToolOpenRouter
chatFunctionTool := components.CreateChatFunctionToolSubagentServerToolOpenRouter(components.SubagentServerToolOpenRouter{/* values here */})
WebFetchServerTool
chatFunctionTool := components.CreateChatFunctionToolWebFetchServerTool(components.WebFetchServerTool{/* values here */})
OpenRouterWebSearchServerTool
chatFunctionTool := components.CreateChatFunctionToolOpenRouterWebSearchServerTool(components.OpenRouterWebSearchServerTool{/* values here */})
ChatWebSearchShorthand
chatFunctionTool := components.CreateChatFunctionToolChatWebSearchShorthand(components.ChatWebSearchShorthand{/* values here */})
ChatDynamicServerTool
chatFunctionTool := components.CreateChatFunctionToolChatDynamicServerTool(components.ChatDynamicServerTool{/* values here */})
Union Discrimination
Use theType field to determine which variant is active, then access the corresponding field:
switch chatFunctionTool.Type {
case components.ChatFunctionToolUnionTypeChatFunctionToolFunction:
// chatFunctionTool.ChatFunctionToolFunction is populated
case components.ChatFunctionToolUnionTypeAdvisorServerToolOpenRouter:
// chatFunctionTool.AdvisorServerToolOpenRouter is populated
case components.ChatFunctionToolUnionTypeBashServerTool:
// chatFunctionTool.BashServerTool is populated
case components.ChatFunctionToolUnionTypeDatetimeServerTool:
// chatFunctionTool.DatetimeServerTool is populated
case components.ChatFunctionToolUnionTypeFilesServerTool:
// chatFunctionTool.FilesServerTool is populated
case components.ChatFunctionToolUnionTypeFusionServerToolOpenRouter:
// chatFunctionTool.FusionServerToolOpenRouter is populated
case components.ChatFunctionToolUnionTypeImageGenerationServerToolOpenRouter:
// chatFunctionTool.ImageGenerationServerToolOpenRouter is populated
case components.ChatFunctionToolUnionTypeChatSearchModelsServerTool:
// chatFunctionTool.ChatSearchModelsServerTool is populated
case components.ChatFunctionToolUnionTypeSubagentServerToolOpenRouter:
// chatFunctionTool.SubagentServerToolOpenRouter is populated
case components.ChatFunctionToolUnionTypeWebFetchServerTool:
// chatFunctionTool.WebFetchServerTool is populated
case components.ChatFunctionToolUnionTypeOpenRouterWebSearchServerTool:
// chatFunctionTool.OpenRouterWebSearchServerTool is populated
case components.ChatFunctionToolUnionTypeChatWebSearchShorthand:
// chatFunctionTool.ChatWebSearchShorthand is populated
case components.ChatFunctionToolUnionTypeChatDynamicServerTool:
// chatFunctionTool.ChatDynamicServerTool is populated
}