varapiKey=Environment.GetEnvironmentVariable("LALALAI_API_KEY")is{Length:>0}value?value:thrownewAssertInconclusiveException("LALALAI_API_KEY environment variable is not found.");usingvarclient=newLalalAIClient(apiKey);// The client provides methods for uploading files, splitting stems,// cleaning voice, changing voice, and checking task status.
MeaiTools
1 2 3 4 5 6 7 8 9101112131415
varapiKey=Environment.GetEnvironmentVariable("LALALAI_API_KEY")is{Length:>0}value?value:thrownewAssertInconclusiveException("LALALAI_API_KEY environment variable is not found.");usingvarclient=newLalalAIClient(apiKey);// Create tools for checking task status, remaining minutes, voice packs, and task cancellation.varcheckTaskStatusTool=client.AsCheckTaskStatusTool();vargetMinutesLeftTool=client.AsGetMinutesLeftTool();varlistVoicePacksTool=client.AsListVoicePacksTool();varcancelTasksTool=client.AsCancelTasksTool();// These tools can be passed to any IChatClient that supports function calling.vartools=new[]{checkTaskStatusTool,getMinutesLeftTool,listVoicePacksTool,cancelTasksTool};