Skip to content

MeaiTools

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

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

using var client = new RevAIClient(apiKey);

// Create tools for transcription, job status, and job listing.
var transcribeTool = client.AsTranscribeUrlTool(defaultLanguage: "en");
var getJobStatusTool = client.AsGetJobStatusTool();
var listJobsTool = client.AsListJobsTool(defaultLimit: 5);

// These tools can be passed to any IChatClient that supports function calling.
var tools = new[] { transcribeTool, getJobStatusTool, listJobsTool };