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
We've built a simple console application that demonstrates how LaunchDarkly's Ruby AI SDK works.
4
+
5
+
Below, you'll find the build procedure. For more comprehensive instructions, you can visit your [Quickstart page](https://docs.launchdarkly.com/home/ai-configs/quickstart) or the [Ruby reference guide](https://docs.launchdarkly.com/sdk/ai/ruby).
6
+
7
+
This demo requires Ruby 3.0 or higher.
8
+
9
+
## Build Instructions
10
+
11
+
This repository includes examples for `OpenAI` and `Bedrock`. Depending on your preferred provider, you may have to take some additional steps.
12
+
13
+
### General setup
14
+
15
+
1. Install the required dependencies with `bundle install` in the appropriate example directory.
16
+
1. Set the environment variable `LAUNCHDARKLY_SDK_KEY` to your LaunchDarkly SDK key. If there is an existing an AI Config in your LaunchDarkly project that you want to evaluate, set `LAUNCHDARKLY_AI_CONFIG_KEY` to the flag key; otherwise, an AI Config of `sample-ai-config` will be assumed.
1. Replace `my-default-model` with your preferred model if the application cannot connect to LaunchDarkly Services.
24
+
25
+
### OpenAI setup
26
+
27
+
1. Set the environment variable `OPENAI_API_KEY` to your OpenAI key.
28
+
29
+
```bash
30
+
export OPENAI_API_KEY="0987654321fedcba"
31
+
```
32
+
33
+
1. Run the program `bundle exec ruby hello_openai.rb`
34
+
35
+
### Bedrock setup
36
+
37
+
1. Ensure the required AWS credentials can be [auto-detected by the AWS client][aws-configuration]. In the provided example we use the following environment variables.
38
+
39
+
```bash
40
+
export AWS_ACCESS_KEY_ID="0987654321fedcba"
41
+
export AWS_SECRET_ACCESS_KEY="0987654321fedcba"
42
+
```
43
+
44
+
1. Run the program `bundle exec ruby hello_bedrock.rb`
0 commit comments