This example assumes using RevAI; is in scope and apiKey contains your RevAI API key.
1 2 3 4 5 6 7 8 91011121314
varapiKey=Environment.GetEnvironmentVariable("REVAI_API_KEY")is{Length:>0}value?value:thrownewAssertInconclusiveException("REVAI_API_KEY environment variable is not found.");usingvarclient=newRevAIClient(apiKey);// Create tools for transcription, job status, and job listing.vartranscribeTool=client.AsTranscribeUrlTool(defaultLanguage:"en");vargetJobStatusTool=client.AsGetJobStatusTool();varlistJobsTool=client.AsListJobsTool(defaultLimit:5);// These tools can be passed to any IChatClient that supports function calling.vartools=new[]{transcribeTool,getJobStatusTool,listJobsTool};