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


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.3rc1.tar.gz (27.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gigachain_openai-0.1.3rc1-py3-none-any.whl (33.5 kB view details)

Uploaded Python 3

File details

Details for the file gigachain_openai-0.1.3rc1.tar.gz.

File metadata

  • Download URL: gigachain_openai-0.1.3rc1.tar.gz
  • Upload date:
  • Size: 27.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.6 Darwin/23.3.0

File hashes

Hashes for gigachain_openai-0.1.3rc1.tar.gz
Algorithm Hash digest
SHA256 eaef8d9598620d54dd068b7a2966fc39424d08c6505097d50875056acc9e9f02
MD5 29eedf4c2860b27f1bc4c09cd07f0d9c
BLAKE2b-256 6508f047e8b8d4afa5fc0568026cb4a9a79709f02e6c595242a2a0ad2666cf52

See more details on using hashes here.

File details

Details for the file gigachain_openai-0.1.3rc1-py3-none-any.whl.

File metadata

File hashes

Hashes for gigachain_openai-0.1.3rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 3e6fbca728846e370e2516e97868cd3dfeca2b9b238d777dd783c284bb997c46
MD5 0c8ae1daa76892f09eacc1c5aee9aa4b
BLAKE2b-256 026a4b6e635483d2656bbd180b37f0152a817a3795c87c74f017eb104f288b79

See more details on using hashes here.

Supported by

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