Skip to content

MEAI Search Tool

Example showing how to use BraveSearch as an AIFunction tool with any IChatClient.

This example assumes using BraveSearch; is in scope and apiKey contains your BraveSearch API key.

1
2
3
4
using var client = new BraveSearchClient(apiKey);

// Create an AIFunction tool from BraveSearch for use with any IChatClient
var searchTool = client.AsSearchTool(count: 3);