Azure OpenAI
Microsoft Azure, often referred to as
Azureis a cloud computing platform run byMicrosoft, which offers access, management, and development of applications and services through global data centers. It provides a range of capabilities, including software as a service (SaaS), platform as a service (PaaS), and infrastructure as a service (IaaS).Microsoft Azuresupports many programming languages, tools, and frameworks, including Microsoft-specific and third-party software and systems.
Azure OpenAI is an
Azureservice with powerful language models fromOpenAIincluding theGPT-3,CodexandEmbeddings modelseries for content generation, summarization, semantic search, and natural language to code translation.
Installation and Setup
pip install openai
pip install tiktoken
Set the environment variables to get access to the Azure OpenAI service.
import os
os.environ["OPENAI_API_TYPE"] = "azure"
os.environ["OPENAI_API_BASE"] = "https://<your-endpoint.openai.azure.com/"
os.environ["OPENAI_API_KEY"] = "your AzureOpenAI key"
os.environ["OPENAI_API_VERSION"] = "2023-05-15"
LLM
See a usage example.
from langchain.llms import AzureOpenAI
API Reference:
- AzureOpenAI from
langchain.llms
Text Embedding Models
See a usage example
from langchain.embeddings import OpenAIEmbeddings
API Reference:
- OpenAIEmbeddings from
langchain.embeddings
Chat Models
See a usage example
from langchain.chat_models import AzureChatOpenAI
API Reference:
- AzureChatOpenAI from
langchain.chat_models