Skip to content

MEAI Tools

Example showing how to use Recombee as MEAI AIFunction tools with any IChatClient.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
// Create an authenticated client
using var client = new RecombeeClient(apiKey);
var databaseId = GetDatabaseId();

// Create AIFunction tools for use with any IChatClient
var recommendTool = client.AsRecommendItemsTool(databaseId);
var searchTool = client.AsSearchItemsTool(databaseId);
var interactionTool = client.AsAddInteractionTool(databaseId);
var listItemsTool = client.AsListItemsTool(databaseId);

// Verify tools are created with correct names