Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 817 Bytes

File metadata and controls

34 lines (23 loc) · 817 Bytes

OpenAI Example (Single Provider)

This example demonstrates how to use LaunchDarkly's AI Config with the OpenAI provider.

Prerequisites

Setup

  1. Create a .env file in this directory with the following variables:

    LAUNCHDARKLY_SDK_KEY=your-launchdarkly-sdk-key
    LAUNCHDARKLY_AI_CONFIG_KEY=sample-ai-config
    OPENAI_API_KEY=your-openai-api-key
    

    LAUNCHDARKLY_AI_CONFIG_KEY defaults to sample-ai-config if not set.

  2. Install the required dependencies:

    poetry install

Run

poetry run openai-example