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
Hashes for gigachain_openai-0.1.3rc1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | eaef8d9598620d54dd068b7a2966fc39424d08c6505097d50875056acc9e9f02 |
|
MD5 | 29eedf4c2860b27f1bc4c09cd07f0d9c |
|
BLAKE2b-256 | 6508f047e8b8d4afa5fc0568026cb4a9a79709f02e6c595242a2a0ad2666cf52 |
Hashes for gigachain_openai-0.1.3rc1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e6fbca728846e370e2516e97868cd3dfeca2b9b238d777dd783c284bb997c46 |
|
MD5 | 0c8ae1daa76892f09eacc1c5aee9aa4b |
|
BLAKE2b-256 | 026a4b6e635483d2656bbd180b37f0152a817a3795c87c74f017eb104f288b79 |