Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

statsig-azureai

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

statsig-azureai

Azure AI library with a built-in Statsig SDK.

beta
latest
npmnpm
Version
1.0.0
Version published
Maintainers
0
Created
Source

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.

Getting Started

  • Install the library npm install statsig-azureai
  • Initialize the main AzureAI interface along with the internal Statsig service
import { AzureAI, StatsigOptions } from "statsig-azureai";

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

await AzureAI.initialize(<STATSIG_SERVER_KEY>, options);
  • 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", <DEPLOYMENT_ENDPOINT_URL>, <DEPLOYMENT_KEY>);
  • 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

FAQs

Package last updated on 12 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts