Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

LangChain Example (Multiple Providers)

This example demonstrates how to use LaunchDarkly's AI Config with LangChain, supporting multiple providers including OpenAI, Anthropic, Google GenAI, and AWS Bedrock. To use a different provider, install the corresponding langchain-* package (e.g. poetry add langchain-mistralai).

Prerequisites

  • Python 3.10 or higher
  • Poetry installed
  • A LaunchDarkly account and SDK key
  • API keys for the providers you want to use

Setup

  1. Create the following config in your LaunchDarkly project. You can use a different key by setting the environment variable in your .env.

  2. Copy .env.example to .env and fill in your keys (only the provider keys for providers you actually use are required):

    cp .env.example .env
  3. Install the required dependencies:

    poetry install

Run

poetry run langchain