Skip to content

Latest commit

 

History

History
53 lines (37 loc) · 1.36 KB

README.md

File metadata and controls

53 lines (37 loc) · 1.36 KB

Statsig Azure AI

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.

More docs are available at: https://statsig.com/azureai-docs

Getting Started

  1. Install the library npm install @statsig/azure-ai
  2. Initialize the main AzureAI interface along with the internal Statsig service
import { AzureAI, StatsigOptions } from "@statsig/azure-ai";

const options: StatsigOptions = {
  environment: { tier: "development" },
};

await AzureAI.initialize(<STATSIG_SERVER_KEY>, options);
  1. Create the AzureAI inference client
const client = AzureAI.getModelClientFromEndpoint(
    <DEPLOYMENT_ENDPOINT_URL>,
    <DEPLOYMENT_KEY>
);

Optionally, use a Statsig Dynamic Config to provide default configurations

const client = AzureAI.getModelClient("azureai_model");
  1. Call the API
const response = await client.complete([
  {
    role: "system",
    content: "You are a helpful assistant. You will talk like a pirate.",
  },
  { role: "user", content: "Can you help me?" },
]);

References