mirror of
https://github.com/hwchase17/langchain.git
synced 2026-06-09 10:17:00 +00:00
chore: enrich pyproject.toml files with links to new references, others (#33343)
This commit is contained in:
@@ -2,60 +2,4 @@
|
||||
|
||||
This package contains the LangChain integrations for OpenAI through their `openai` SDK.
|
||||
|
||||
## Installation and Setup
|
||||
|
||||
- Install the LangChain partner package
|
||||
|
||||
```bash
|
||||
pip install langchain-openai
|
||||
```
|
||||
|
||||
- Get an OpenAI api key and set it as an environment variable (`OPENAI_API_KEY`)
|
||||
|
||||
## Chat model
|
||||
|
||||
See a [usage example](https://python.langchain.com/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 [AzureChatOpenAI](https://python.langchain.com/docs/integrations/chat/azure_chat_openai)
|
||||
|
||||
## Text Embedding Model
|
||||
|
||||
See a [usage example](https://python.langchain.com/docs/integrations/text_embedding/openai)
|
||||
|
||||
```python
|
||||
from langchain_openai import OpenAIEmbeddings
|
||||
```
|
||||
|
||||
If you are using a model hosted on `Azure`, you should use different wrapper for that:
|
||||
|
||||
```python
|
||||
from langchain_openai import AzureOpenAIEmbeddings
|
||||
```
|
||||
|
||||
For a more detailed walkthrough of the `Azure` wrapper, see [AzureOpenAIEmbeddings](https://python.langchain.com/docs/integrations/text_embedding/azureopenai)
|
||||
|
||||
## LLM (Legacy)
|
||||
|
||||
LLM refers to the legacy text-completion models that preceded chat models. See a [usage example](https://python.langchain.com/docs/integrations/llms/openai).
|
||||
|
||||
```python
|
||||
from langchain_openai import OpenAI
|
||||
```
|
||||
|
||||
If you are using a model hosted on `Azure`, you should use different wrapper for that:
|
||||
|
||||
```python
|
||||
from langchain_openai import AzureOpenAI
|
||||
```
|
||||
|
||||
For a more detailed walkthrough of the `Azure` wrapper, see [Azure OpenAI](https://python.langchain.com/docs/integrations/llms/azure_openai)
|
||||
View the [documentation](https://docs.langchain.com/oss/python/integrations/providers/openai) for more details.
|
||||
|
||||
Reference in New Issue
Block a user