This example assumes using Speechmatics; is in scope and apiKey contains your Speechmatics API key.
1 2 3 4 5 6 7 8 91011121314
varapiKey=Environment.GetEnvironmentVariable("SPEECHMATICS_API_KEY")is{Length:>0}value?value:thrownewAssertInconclusiveException("SPEECHMATICS_API_KEY environment variable is not found.");usingvarclient=newSpeechmaticsClient(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};