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 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gigachain_openai-0.1.22.tar.gz (45.6 kB view details)

Uploaded Source

Built Distribution

gigachain_openai-0.1.22-py3-none-any.whl (52.0 kB view details)

Uploaded Python 3

File details

Details for the file gigachain_openai-0.1.22.tar.gz.

File metadata

  • Download URL: gigachain_openai-0.1.22.tar.gz
  • Upload date:
  • Size: 45.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.5 Darwin/23.5.0

File hashes

Hashes for gigachain_openai-0.1.22.tar.gz
Algorithm Hash digest
SHA256 df72510210497a3d58baf306202054547c337b36c5ec793f72305b4b36b2541f
MD5 70bd1f1345e6faf2cb2fd98af44dd917
BLAKE2b-256 8c0606d2e7806bcaa9bd9d75ab06136b16c92d3f1a68e1755d437020cd309020

See more details on using hashes here.

File details

Details for the file gigachain_openai-0.1.22-py3-none-any.whl.

File metadata

File hashes

Hashes for gigachain_openai-0.1.22-py3-none-any.whl
Algorithm Hash digest
SHA256 d07a896bd61903a7abc0e7542fb8a306e5b077e3381a3df636f0eb0bdc3c8fcf
MD5 f235e27021cee2dc9f1cd4414bcb32df
BLAKE2b-256 99facec91ef2c92a1acd989fb1b04953a9d85463c3d0f0470fce509f6c2f0cda

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