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 gigachain-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 gigachain-openai 0.1.22

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

Source distribution (sdist)

Source distribution for gigachain-openai 0.1.22
File Size Uploaded
gigachain_openai-0.1.22.tar.gz 45.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gigachain-openai 0.1.22
File Interpreter ABI Platform
gigachain_openai-0.1.22-py3-none-any.whl Python 3 none any Details

Total release size: 97.6 kB

Release files / gigachain_openai-0.1.22.tar.gz

Download URL gigachain_openai-0.1.22.tar.gz
Size 45.6 kB
Tags Source
SHA-256 checksum
How to use checksums
df72510210497a3d58baf306202054547c337b36c5ec793f72305b4b36b2541f
BLAKE2b-256 checksum
How to use checksums
8c0606d2e7806bcaa9bd9d75ab06136b16c92d3f1a68e1755d437020cd309020
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.5 Darwin/23.5.0

Release files / gigachain_openai-0.1.22-py3-none-any.whl

Download URL gigachain_openai-0.1.22-py3-none-any.whl
Size 52.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d07a896bd61903a7abc0e7542fb8a306e5b077e3381a3df636f0eb0bdc3c8fcf
BLAKE2b-256 checksum
How to use checksums
99facec91ef2c92a1acd989fb1b04953a9d85463c3d0f0470fce509f6c2f0cda
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.5 Darwin/23.5.0
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