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
pip install azureai-statsig
- Initialize the main AzureAI interface along with the internal Statsig service
AzureAI.initialize(<STATSIG_SERVER_KEY>, StatsigOptions(tier="development"))
- Create the AzureAI inference client
client = AzureAI.get_model_client_from_endpoint(<DEPLOYMENT_ENDPOINT_URL>, <DEPLOYMENT_KEY>)
Optionally, use a Statsig Dynamic Config to provide default configurations
client = AzureAI.get_model_client("azureai_model", <DEPLOYMENT_ENDPOINT_URL>, <DEPLOYMENT_KEY>)
- Call the API
response = client.complete([
SystemMessage(content="You are a helpful assistant."),
UserMessage(content="Give me 5 good reasons why I should exercise every day.")
])
- Azure AI SDK documentation
- Statsig SDK documentation