Azure OpenAI
Before you start
- Head over to Azure OpenAI (opens in a new tab) and create an instance if you don't have one.
- Create a new model deployment on Azure AI and configure it as you wish.
- Set the following environment variables:
AZURE_OPENAI_ENDPOINT
- your Azure OpenAI endpointAZURE_OPENAI_API_KEY
- your Azure OpenAI API key
Usage
import { UniLLM } from 'unillm';
/*
#SETUP#
*/
// Setup UniLLM
const unillm = new UniLLM();
// Use any LLM provider and model
const response = await unillm.createChatCompletion("#MODEL#", {
temperature: 0,
messages: [
{
role: "user",
content: "How are you?"
}
]
})