docs[patch]: Add caution on OpenAI LLMs integration page (#22754)

@baskaryan do we like?

<img width="1040" alt="Screenshot 2024-06-10 at 12 16 45 PM"
src="https://github.com/langchain-ai/langchain/assets/6952323/8893063f-1acf-4a56-9ee5-a8a2b1560277">
This commit is contained in:
Jacob Lee 2024-06-10 13:27:22 -07:00 committed by GitHub
parent c3cce98d86
commit e4183cbc4e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 49 additions and 40 deletions

View File

@ -23,13 +23,11 @@
] ]
}, },
{ {
"cell_type": "raw", "cell_type": "code",
"execution_count": null,
"id": "d83ba7de", "id": "d83ba7de",
"metadata": { "metadata": {},
"vscode": { "outputs": [],
"languageId": "raw"
}
},
"source": [ "source": [
"%pip install -qU langchain-openai" "%pip install -qU langchain-openai"
] ]

View File

@ -7,7 +7,13 @@
"source": [ "source": [
"# Azure OpenAI\n", "# Azure OpenAI\n",
"\n", "\n",
"This notebook goes over how to use Langchain with [Azure OpenAI](https://aka.ms/azure-openai).\n", ":::caution\n",
"You are currently on a page documenting the use of Azure OpenAI [text completion models](/docs/concepts/#llms). The latest and most popular Azure OpenAI models are [chat completion models](/docs/concepts/#chat-models).\n",
"\n",
"Unless you are specifically using `gpt-3.5-turbo-instruct`, you are probably looking for [this page instead](/docs/integrations/chat/azure_chat_openai/).\n",
":::\n",
"\n",
"This page goes over how to use LangChain with [Azure OpenAI](https://aka.ms/azure-openai).\n",
"\n", "\n",
"The Azure OpenAI API is compatible with OpenAI's API. The `openai` Python package makes it easy to use both OpenAI and Azure OpenAI. You can call Azure OpenAI the same way you call OpenAI with the exceptions noted below.\n", "The Azure OpenAI API is compatible with OpenAI's API. The `openai` Python package makes it easy to use both OpenAI and Azure OpenAI. You can call Azure OpenAI the same way you call OpenAI with the exceptions noted below.\n",
"\n", "\n",

View File

@ -7,6 +7,12 @@
"source": [ "source": [
"# OpenAI\n", "# OpenAI\n",
"\n", "\n",
":::caution\n",
"You are currently on a page documenting the use of OpenAI [text completion models](/docs/concepts/#llms). The latest and most popular OpenAI models are [chat completion models](/docs/concepts/#chat-models).\n",
"\n",
"Unless you are specifically using `gpt-3.5-turbo-instruct`, you are probably looking for [this page instead](/docs/integrations/chat/openai/).\n",
":::\n",
"\n",
"[OpenAI](https://platform.openai.com/docs/introduction) offers a spectrum of models with different levels of power suitable for different tasks.\n", "[OpenAI](https://platform.openai.com/docs/introduction) offers a spectrum of models with different levels of power suitable for different tasks.\n",
"\n", "\n",
"This example goes over how to use LangChain to interact with `OpenAI` [models](https://platform.openai.com/docs/models)" "This example goes over how to use LangChain to interact with `OpenAI` [models](https://platform.openai.com/docs/models)"

View File

@ -6,24 +6,6 @@ keywords: [azure]
All functionality related to `Microsoft Azure` and other `Microsoft` products. All functionality related to `Microsoft Azure` and other `Microsoft` products.
## LLMs
### Azure ML
See a [usage example](/docs/integrations/llms/azure_ml).
```python
from langchain_community.llms.azureml_endpoint import AzureMLOnlineEndpoint
```
### Azure OpenAI
See a [usage example](/docs/integrations/llms/azure_openai).
```python
from langchain_openai import AzureOpenAI
```
## Chat Models ## Chat Models
### Azure OpenAI ### Azure OpenAI
@ -51,6 +33,24 @@ See a [usage example](/docs/integrations/chat/azure_chat_openai)
from langchain_openai import AzureChatOpenAI from langchain_openai import AzureChatOpenAI
``` ```
## LLMs
### Azure ML
See a [usage example](/docs/integrations/llms/azure_ml).
```python
from langchain_community.llms.azureml_endpoint import AzureMLOnlineEndpoint
```
### Azure OpenAI
See a [usage example](/docs/integrations/llms/azure_openai).
```python
from langchain_openai import AzureOpenAI
```
## Embedding Models ## Embedding Models
### Azure OpenAI ### Azure OpenAI

View File

@ -25,6 +25,19 @@ pip install langchain-openai
Get an OpenAI api key and set it as an environment variable (`OPENAI_API_KEY`) Get an OpenAI api key and set it as an environment variable (`OPENAI_API_KEY`)
## Chat model
See a [usage example](/docs/integrations/chat/openai).
```python
from langchain_openai import ChatOpenAI
```
If you are using a model hosted on `Azure`, you should use different wrapper for that:
```python
from langchain_openai import AzureChatOpenAI
```
For a more detailed walkthrough of the `Azure` wrapper, see [here](/docs/integrations/chat/azure_chat_openai).
## LLM ## LLM
@ -38,21 +51,7 @@ If you are using a model hosted on `Azure`, you should use different wrapper for
```python ```python
from langchain_openai import AzureOpenAI from langchain_openai import AzureOpenAI
``` ```
For a more detailed walkthrough of the `Azure` wrapper, see [here](/docs/integrations/llms/azure_openai) For a more detailed walkthrough of the `Azure` wrapper, see [here](/docs/integrations/llms/azure_openai).
## Chat model
See a [usage example](/docs/integrations/chat/openai).
```python
from langchain_openai import ChatOpenAI
```
If you are using a model hosted on `Azure`, you should use different wrapper for that:
```python
from langchain_openai import AzureChatOpenAI
```
For a more detailed walkthrough of the `Azure` wrapper, see [here](/docs/integrations/chat/azure_chat_openai)
## Embedding Model ## Embedding Model