You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This package demonstrates the integration of LaunchDarkly's AI SDK with AWS Bedrock, allowing you to leverage LaunchDarkly's AI Config capabilities in AI-powered applications using AWS Bedrock.
4
+
5
+
## Installation
6
+
7
+
To install the package and its dependencies, run:
8
+
9
+
```bash
10
+
npm install
11
+
```
12
+
13
+
## Configuration
14
+
15
+
Before running the example, make sure to set the following environment variables:
16
+
17
+
-`LAUNCHDARKLY_SDK_KEY`: Your LaunchDarkly SDK key
18
+
-`LAUNCHDARKLY_AI_CONFIG_KEY`: Your LaunchDarkly AI configuration key (defaults to 'sample-ai-config' if not set)
19
+
20
+
Additionally, ensure you have proper AWS credentials configured to access Bedrock services.
This package demonstrates the integration of LaunchDarkly's AI SDK with OpenAI, allowing you to leverage LaunchDarkly's AI Config capabilities in AI-powered applications using OpenAI's services.
4
+
5
+
## Installation
6
+
7
+
To install the package and its dependencies, run:
8
+
9
+
```bash
10
+
npm install
11
+
```
12
+
13
+
## Configuration
14
+
15
+
Before running the example, make sure to set the following environment variables:
16
+
17
+
-`LAUNCHDARKLY_SDK_KEY`: Your LaunchDarkly SDK key
18
+
-`LAUNCHDARKLY_AI_CONFIG_KEY`: Your LaunchDarkly AI configuration key (defaults to 'sample-ai-config' if not set)
19
+
-`OPENAI_API_KEY`: Your OpenAI API key
20
+
21
+
## Usage
22
+
23
+
The main script (`index.js`) demonstrates how to:
24
+
25
+
1. Initialize the LaunchDarkly SDK
26
+
2. Set up a user context
27
+
3. Initialize the LaunchDarkly AI client
28
+
4. Retrieve an AI model configuration
29
+
5. Send a prompt to OpenAI
30
+
6. Track token usage
31
+
32
+
To run the example:
33
+
34
+
```bash
35
+
node index.js
36
+
```
37
+
38
+
## Note
39
+
40
+
This example uses OpenAI's chat completions API. Make sure your LaunchDarkly AI configuration is set up correctly to work with OpenAI's models and API structure.
0 commit comments