Skip to content

MeaiTools

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
var apiKey =
    Environment.GetEnvironmentVariable("JASPERAI_API_KEY") is { Length: > 0 } value
        ? value
        : throw new AssertInconclusiveException("JASPERAI_API_KEY environment variable is not found.");

using var client = new JasperAIClient(apiKey);

// Create tools for content generation, knowledge search, task listing, and voice listing.
var generateContentTool = client.AsGenerateContentTool();
var searchKnowledgeTool = client.AsSearchKnowledgeTool();
var listTasksTool = client.AsListTasksTool();
var listVoicesTool = client.AsListVoicesTool();

// These tools can be passed to any IChatClient that supports function calling.
var tools = new[] { generateContentTool, searchKnowledgeTool, listTasksTool, listVoicesTool };