Skip to content

MEAI Tools

Use Pinecone operations as AIFunction tools with any Microsoft.Extensions.AI IChatClient.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
// Create MEAI AIFunction tools for use with any IChatClient.
using var client = new PineconeClient(apiKey);

var tools = new List<AITool>
{
    client.AsListIndexesTool(),
    client.AsDescribeIndexTool(),
    client.AsEmbedTool(),
    client.AsRerankTool(),
    client.AsListModelsTool(),
    client.AsListCollectionsTool(),
};

foreach (var tool in tools.Cast<AIFunction>())
{
    Console.WriteLine($"  Tool: {tool.Name} - {tool.Description}");
}