AZURE_OPENAI_KEY= AZURE_OPENAI_ENDPOINT= AZURE_OPENAI_API_VERSION= AZURE_OPENAI_DEPLOYMENT= OPENAI_API_TYPE="azure"
import { OpenAI, serviceContextFromDefaults } from "llamaindex"; const openaiLLM = new OpenAI(); const serviceContext = serviceContextFromDefaults({ llm: openaiLLM });
const openaiLLM = new OpenAI({ temperature: 0, azure: { deploymentName: "llmDeployment" } }); const openaiEmbeds = new OpenAIEmbedding({ azure: { deploymentName: "embedDeployment" } }); const serviceContext = serviceContextFromDefaults({ embedModel: openaiEmbeds, llm: openaiLLM, });