Skip to main content

langchain-openai

This package contains the Aibaba AI integrations for OpenAI through their openai SDK.

Installation and Setup

  • Install the Aibaba AI 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

Release files for aibaba_ai_openai 0.2.14

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

Source distribution (sdist)

Source distribution for aibaba_ai_openai 0.2.14
File Size Uploaded
aibaba_ai_openai-0.2.14.tar.gz 44.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aibaba_ai_openai 0.2.14
File Interpreter ABI Platform
aibaba_ai_openai-0.2.14-py3-none-any.whl Python 3 none any Details

Total release size: 95.0 kB

Release files / aibaba_ai_openai-0.2.14.tar.gz

Download URL aibaba_ai_openai-0.2.14.tar.gz
Size 44.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1e3c7169097462c2aa6c01801c1739517ecfc6e29a6c88b2cff72a7662998996
BLAKE2b-256 checksum
How to use checksums
b08f348eb20f22465bb79bd39650d75f0f106a04d4e952612f79376d026ba16f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.12.3 Linux/5.15.167.4-microsoft-standard-WSL2

Release files / aibaba_ai_openai-0.2.14-py3-none-any.whl

Download URL aibaba_ai_openai-0.2.14-py3-none-any.whl
Size 51.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cd729b1de7ab32e00c695c0d93c394cd44250da9f0a4153406ae77a150e626b6
BLAKE2b-256 checksum
How to use checksums
c4ab6f767ac3ac1f4da2ac58488f00e38b2f7624d269f8bd96e42f5dbc6546ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.12.3 Linux/5.15.167.4-microsoft-standard-WSL2

Release history Release notifications | RSS feed

This release

0.2.14 This release

2 release files

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