Example showing how to get personalized item recommendations for a user.
1 2 3 4 5 6 7 8 910111213
// Create an authenticated clientusingvarclient=newRecombeeClient(apiKey);vardatabaseId=GetDatabaseId();// Get personalized recommendations for a uservarresponse=awaitclient.Recommendations.CreateByDatabaseIdRecommsUsersByUserIdItemsAsync(databaseId:databaseId,userId:"test-user-1",count:5,cascadeCreate:true,returnProperties:true);// The response contains a recommendation ID and list of recommended items
Search
Example showing how to search items with personalized full-text search.
1 2 3 4 5 6 7 8 91011121314
// Create an authenticated clientusingvarclient=newRecombeeClient(apiKey);vardatabaseId=GetDatabaseId();// Search items with personalized full-text searchvarresponse=awaitclient.Search.CreateByDatabaseIdSearchUsersByUserIdItemsAsync(databaseId:databaseId,userId:"test-user-1",searchQuery:"laptop",count:5,cascadeCreate:true,returnProperties:true);// The response contains a recommendation ID and ranked search results
MEAI Tools
Example showing how to use Recombee as MEAI AIFunction tools with any IChatClient.
1 2 3 4 5 6 7 8 91011
// Create an authenticated clientusingvarclient=newRecombeeClient(apiKey);vardatabaseId=GetDatabaseId();// Create AIFunction tools for use with any IChatClientvarrecommendTool=client.AsRecommendItemsTool(databaseId);varsearchTool=client.AsSearchItemsTool(databaseId);varinteractionTool=client.AsAddInteractionTool(databaseId);varlistItemsTool=client.AsListItemsTool(databaseId);// Verify tools are created with correct names