This example assumes using JasperAI; is in scope and apiKey contains your JasperAI API key.
1 2 3 4 5 6 7 8 9101112131415
varapiKey=Environment.GetEnvironmentVariable("JASPERAI_API_KEY")is{Length:>0}value?value:thrownewAssertInconclusiveException("JASPERAI_API_KEY environment variable is not found.");usingvarclient=newJasperAIClient(apiKey);// Create tools for content generation, knowledge search, task listing, and voice listing.vargenerateContentTool=client.AsGenerateContentTool();varsearchKnowledgeTool=client.AsSearchKnowledgeTool();varlistTasksTool=client.AsListTasksTool();varlistVoicesTool=client.AsListVoicesTool();// These tools can be passed to any IChatClient that supports function calling.vartools=new[]{generateContentTool,searchKnowledgeTool,listTasksTool,listVoicesTool};