An integration package connecting OpenAI and LangChain
Project description
langchain-openai
This package contains the LangChain integrations for OpenAI through their openai SDK.
Installation and Setup
- Install the LangChain partner package
pip install langchain-openai
- Get an OpenAI api key and set it as an environment variable (
OPENAI_API_KEY)
LLM
See a usage example.
from langchain_openai import OpenAI
If you are using a model hosted on Azure, you should use different wrapper for that:
from langchain_openai import AzureOpenAI
For a more detailed walkthrough of the Azure wrapper, see here
Chat model
See a usage example.
from langchain_openai import ChatOpenAI
If you are using a model hosted on Azure, you should use different wrapper for that:
from langchain_openai import AzureChatOpenAI
For a more detailed walkthrough of the Azure wrapper, see here
Text Embedding Model
See a usage example
from langchain_openai import OpenAIEmbeddings
If you are using a model hosted on Azure, you should use different wrapper for that:
from langchain_openai import AzureOpenAIEmbeddings
For a more detailed walkthrough of the Azure wrapper, see here
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langchain_openai-0.1.5.tar.gz.
File metadata
- Download URL: langchain_openai-0.1.5.tar.gz
- Upload date:
- Size: 27.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c161890f871f8675eb633dcebb53173527045996468ed9d393ed892448408ab1
|
|
| MD5 |
0871299ff5b6972a2410703ca53a62a1
|
|
| BLAKE2b-256 |
7660a1d3534115c35fb3e0955df61556fab064f2a7e501bb00bda0e4af240ee0
|
File details
Details for the file langchain_openai-0.1.5-py3-none-any.whl.
File metadata
- Download URL: langchain_openai-0.1.5-py3-none-any.whl
- Upload date:
- Size: 34.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8789af68afe747fd05acbe5190e5f0f17cbcce4c07bc58f0584f169318ed9f1c
|
|
| MD5 |
280913fa30dc4512b706e0f1fce8828c
|
|
| BLAKE2b-256 |
5e9c4d42e1d362c84b2f51ddeeae82f366596a70173844ea7c9c8abec6ce4e1f
|