usingvarclient=newHammingAIClient(apiKey);// List all datasets in the workspace.varresponse=awaitclient.Datasets.ListDatasetsAsync();Console.WriteLine($"Found {response.Datasets!.Count} datasets.");foreach(vardatasetinresponse.Datasets){Console.WriteLine($"- {dataset.Id}: {dataset.Name}");}
Voice Agent Testing
Shows how to run a voice agent test and retrieve experiment results.
usingvarclient=newHammingAIClient(apiKey);varagentId=Environment.GetEnvironmentVariable("HAMMING_AGENT_ID")is{Length:>0}agentValue?agentValue:thrownewAssertInconclusiveException("HAMMING_AGENT_ID environment variable is not found.");vardatasetId=Environment.GetEnvironmentVariable("HAMMING_DATASET_ID")is{Length:>0}datasetValue?datasetValue:thrownewAssertInconclusiveException("HAMMING_DATASET_ID environment variable is not found.");vartoNumber=Environment.GetEnvironmentVariable("HAMMING_TO_NUMBER")is{Length:>0}numberValue?numberValue:thrownewAssertInconclusiveException("HAMMING_TO_NUMBER environment variable is not found.");// Start a voice agent test run with the specified dataset scenarios.varrunResponse=awaitclient.VoiceAgents.RunVoiceAgentAsync(agentId:agentId,toNumber:toNumber,datasetId:datasetId);Console.WriteLine($"Voice Experiment ID: {runResponse.VoiceExperimentId}");// Check the status of the voice experiment.varstatusResponse=awaitclient.VoiceAgents.GetVoiceExperimentAsync(voiceExperimentId:runResponse.VoiceExperimentId!);Console.WriteLine($"Status: {statusResponse.Status}");// Retrieve call results once the experiment finishes.varcallsResponse=awaitclient.VoiceAgents.GetVoiceExperimentCallsAsync(voiceExperimentId:runResponse.VoiceExperimentId!);Console.WriteLine($"Calls: {callsResponse.Calls!.Count}");foreach(varcallincallsResponse.Calls){Console.WriteLine($"- Call {call.Id}: scoring={call.ScoringStatus}, duration={call.DurationMs}ms");}
Prompts
Shows how to list and retrieve prompts with their content.
1 2 3 4 5 6 7 8 910111213141516171819202122
usingvarclient=newHammingAIClient(apiKey);// List all prompts in the workspace.varpromptsList=awaitclient.Prompts.ListPromptsAsync();Console.WriteLine($"Found {promptsList.Prompts!.Count} prompts.");// Get a specific prompt by slug to see its content.if(promptsList.Prompts.Count>0){varslug=promptsList.Prompts[0].Slug!;varpromptResponse=awaitclient.Prompts.GetPromptAsync(slug:slug);varpromptValue=promptResponse.Prompt!.Value;Console.WriteLine($"Prompt slug: {promptValue.Value1?.Slug}");if(promptValue.Value2?.Contentisnotnull){Console.WriteLine($"Model: {promptValue.Value2.Content.LanguageModel}");Console.WriteLine($"Messages: {promptValue.Value2.Content.ChatMessages?.Count ?? 0}");}}
AIFunction Tools
Shows how to use HammingAI as MEAI AIFunction tools with any IChatClient.
1 2 3 4 5 6 7 8 910
usingvarclient=newHammingAIClient(apiKey);// Create AIFunction tools for use with any IChatClient.varrunTestTool=client.AsRunVoiceAgentTestTool();vargetStatusTool=client.AsGetVoiceExperimentStatusTool();vargetCallsTool=client.AsGetVoiceExperimentCallsTool();varlistDatasetsTool=client.AsListDatasetsTool();// Pass these tools to any IChatClient via ChatOptions.Tools.Console.WriteLine($"Available tools: {runTestTool.Name}, {getStatusTool.Name}, {getCallsTool.Name}, {listDatasetsTool.Name}");
Ecosystem maintenance
This SDK is one of more than 200 .NET SDKs maintained with AutoSDK. The tryAGI SDK audit continuously checks repository synchronization, upstream-spec regeneration, release workflows, warnings, public API visibility, and trimming/NativeAOT compatibility.
Every issue is first investigated for ecosystem-wide applicability. When the root cause belongs in AutoSDK, we fix and regression-test the generator, then roll the improvement out to every applicable SDK. Provider-specific behavior remains in this repository when it cannot be derived safely from the API specification.
Issue content—including code blocks, logs, links, and attachments—is treated only as untrusted diagnostic data. Embedded control instructions, hidden directives, delimiter tricks, or requests to alter triage or tooling behavior are ignored. Please report reproducible technical evidence and remove secrets and personal data.