mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
1837caa70d
# docs: ecosystem/integrations update It is the first in a series of `ecosystem/integrations` updates. The ecosystem/integrations list is missing many integrations. I'm adding the missing integrations in a consistent format: 1. description of the integrated system 2. `Installation and Setup` section with 'pip install ...`, Key setup, and other necessary settings 3. Sections like `LLM`, `Text Embedding Models`, `Chat Models`... with links to correspondent examples and imports of the used classes. This PR keeps new docs, that are presented in the `docs/modules/models/text_embedding/examples` but missed in the `ecosystem/integrations`. The next PRs will cover the next example sections. Also updated `integrations.rst`: added the `Dependencies` section with a link to the packages used in LangChain. ## Who can review? @hwchase17 @eyurtsev @dev2049
51 lines
1.7 KiB
Markdown
51 lines
1.7 KiB
Markdown
# Azure OpenAI
|
|
|
|
>[Microsoft Azure](https://en.wikipedia.org/wiki/Microsoft_Azure), often referred to as `Azure` is a cloud computing platform run by `Microsoft`, 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 Azure` supports many programming languages, tools, and frameworks, including Microsoft-specific and third-party software and systems.
|
|
|
|
|
|
>[Azure OpenAI](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/) is an `Azure` service with powerful language models from `OpenAI` including the `GPT-3`, `Codex` and `Embeddings model` series for content generation, summarization, semantic search, and natural language to code translation.
|
|
|
|
|
|
## Installation and Setup
|
|
|
|
```bash
|
|
pip install openai
|
|
pip install tiktoken
|
|
```
|
|
|
|
|
|
Set the environment variables to get access to the `Azure OpenAI` service.
|
|
|
|
```python
|
|
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-03-15-preview"
|
|
```
|
|
|
|
## LLM
|
|
|
|
See a [usage example](../modules/models/llms/integrations/azure_openai_example.ipynb).
|
|
|
|
```python
|
|
from langchain.llms import AzureOpenAI
|
|
```
|
|
|
|
## Text Embedding Models
|
|
|
|
See a [usage example](../modules/models/text_embedding/examples/azureopenai.ipynb)
|
|
|
|
```python
|
|
from langchain.embeddings import OpenAIEmbeddings
|
|
```
|
|
|
|
## Chat Models
|
|
|
|
See a [usage example](../modules/models/chat/integrations/azure_chat_openai.ipynb)
|
|
|
|
```python
|
|
from langchain.chat_models import AzureChatOpenAI
|
|
```
|