varapiKey=Environment.GetEnvironmentVariable("JASPERAI_API_KEY")is{Length:>0}value?value:thrownewAssertInconclusiveException("JASPERAI_API_KEY environment variable is not found.");usingvarclient=newJasperAIClient(apiKey);// The client provides access to all Jasper AI API endpoints// through sub-clients: Command, Tasks, Knowledge, Voices, Styles, Documents, Users, Audiences, Usage.
MeaiTools
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};