Skip to main content

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

langchain_openai-0.0.5.tar.gz (22.6 kB view details)

Uploaded Source

Built Distribution

langchain_openai-0.0.5-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

File details

Details for the file langchain_openai-0.0.5.tar.gz.

File metadata

  • Download URL: langchain_openai-0.0.5.tar.gz
  • Upload date:
  • Size: 22.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for langchain_openai-0.0.5.tar.gz
Algorithm Hash digest
SHA256 f317fee5b652949ad96ad7edf8ef7a044a6a3f0cc71d1e12f9d5261789fd68c4
MD5 3cefe1ee3885b8bb98a8672e078583f4
BLAKE2b-256 74f6f81578866358d7b2e2b51703bfb20ef239c8d5353f715c9d3c35f9a0bd1d

See more details on using hashes here.

File details

Details for the file langchain_openai-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_openai-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 93b37dfac274adad65e46d5d6e71411e00c6984bcc5e10f1d6bb58e7944dc01b
MD5 b77a46f0ce48e5aab4732250522d9b5e
BLAKE2b-256 a28605012e5276dde3004cfb0cb383f56983d3adcb5bc8ce13ebf21ce3ea3d26

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page