This example demonstrates how to use LaunchDarkly's AI Config with the OpenAI provider.
- Python 3.10 or higher
- Poetry installed
- A LaunchDarkly account with an AI Config created
- An OpenAI API key
-
Create a
.envfile 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-keyLAUNCHDARKLY_AI_CONFIG_KEYdefaults tosample-ai-configif not set. -
Install the required dependencies:
poetry install
poetry run openai-example