Enable AI models to use external functions and services by defining tool schemas or connecting to Model Context Protocol (MCP) servers. This allows AI to interact with databases, APIs, file systems, and more.
response, err := client.ChatCompletionRequest(context.Background(), &schemas.BifrostRequest{ Provider: schemas.OpenAI, Model: "gpt-4o-mini", Input: schemas.RequestInput{ ChatCompletionInput: &[]schemas.BifrostMessage{ { Role: schemas.ModelChatMessageRoleUser, Content: schemas.MessageContent{ ContentStr: bifrost.Ptr("What's the weather in New York and calculate 15% tip for a $50 bill?"), }, }, }, }, Params: &schemas.ModelParameters{ Tools: &[]schemas.Tool{weatherTool, calculatorTool}, ToolChoice: bifrost.Ptr("auto"), // Let AI decide which tools to use },})