Skip to main content

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

Metadata

Release files for langchain-openai 0.2.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-openai 0.2.6
File Size Uploaded Provenance Actions
langchain_openai-0.2.6.tar.gz 43.2 kB Without provenance Details for langchain_openai-0.2.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langchain-openai 0.2.6
File Interpreter ABI Platform Actions
langchain_openai-0.2.6-py3-none-any.whl Python 3 none any Details for langchain_openai-0.2.6-py3-none-any.whl

Total release size: 93.5 kB

Release files / langchain_openai-0.2.6.tar.gz

Download URL langchain_openai-0.2.6.tar.gz
Size 43.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7054e5f64498ad8e59d77cdc210103f5ea4f67258997edc48ae237298adeb316
BLAKE2b-256 checksum
How to use checksums
936791e89373c8d6c670bd092d04078086b8e15028caae11708a162f80ae5201
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Release files / langchain_openai-0.2.6-py3-none-any.whl

Download URL langchain_openai-0.2.6-py3-none-any.whl
Size 50.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d56e4d9183bdd1a5fb5f3ed9d287f15108e01d631ded170dd330a566f2927b95
BLAKE2b-256 checksum
How to use checksums
a271789e9a66d3af707928b1bb42a67b1e93798c80a4b6a064bad32803cd1b79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Security for langchain-openai 0.2.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.6 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page