Skip to content

Latest commit

 

History

History
43 lines (29 loc) · 1.15 KB

File metadata and controls

43 lines (29 loc) · 1.15 KB

Bedrock Example (Single Provider)

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

Prerequisites

  • Python 3.10 or higher
  • Poetry installed
  • A LaunchDarkly account with an AI Config created
  • AWS credentials configured for Bedrock access

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
    

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

  2. Ensure your AWS credentials can be auto-detected by the boto3 library. You can set them in your .env file:

    AWS_ACCESS_KEY_ID=your-access-key-id
    AWS_SECRET_ACCESS_KEY=your-secret-access-key
    AWS_DEFAULT_REGION=us-east-1
    

    Other options include role providers or shared credential files.

  3. Install the required dependencies:

    poetry install

Run

poetry run bedrock-example