Azure AI library with a built-in Statsig SDK.
Statsig helps you move faster with Feature Gates (Feature Flags) and Dynamic Configs. It also allows you to run A/B tests to validate your new features and understand their impact on your KPIs. If you're new to Statsig, create an account at statsig.com.
- Install the library
dotnet add package StatsigAzureAI
- Initialize the main AzureAI interface along with the internal Statsig service
using Statsig;
using Statsig.AzureAI;
var options = new StatsigOptions(environment: new StatsigEnvironment(EnvironmentTier.Development));
await Server.Initialize(<STATSIG_SERVER_KEY>, options);
- Create the AzureAI inference client
var client = Server.GetModelClientFromEndpoint(
<DEPLOYMENT_ENDPOINT_URL>,
<DEPLOYMENT_KEY>
);
Optionally, use a Statsig Dynamic Config to provide default configurations
var client = Server.GetModelClient("azureai_model", <DEPLOYMENT_ENDPOINT_URL>, <DEPLOYMENT_KEY>);
- Call the API
var completion = await client.Complete(
"You are a helpful assistant that speaks like a pirate",
"How do you train a parrot in 10 easy steps?"
);
- Statsig SDK documentation