Skip to content

Commit c75ba9d

Browse files
author
Daniel OBrien
committed
update examples to emit
fix mustache import
1 parent e79b713 commit c75ba9d

File tree

6 files changed

+20
-8
lines changed

6 files changed

+20
-8
lines changed

packages/sdk/server-ai/examples/bedrock/README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,20 @@
22

33
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.
44

5-
## Installation
5+
## Installation and Build
66

77
To install the package and its dependencies, run:
88

99
```bash
1010
npm install
1111
```
1212

13+
Then build the project:
14+
15+
```bash
16+
npm run build
17+
```
18+
1319
## Configuration
1420

1521
Before running the example, make sure to set the following environment variables:
@@ -33,5 +39,5 @@ The main script (`index.js`) demonstrates how to:
3339
To run the example:
3440

3541
```bash
36-
node index.js
42+
node dist/index.js
3743
```

packages/sdk/server-ai/examples/bedrock/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { init } from '@launchdarkly/node-server-sdk';
55
import { initAi, LDAIConfig } from '@launchdarkly/node-server-sdk-ai';
66

77
const sdkKey = process.env.LAUNCHDARKLY_SDK_KEY;
8-
const aiConfigKey = process.env.LAUNCHDARKLY_AI_CONFIG_KEY;
8+
const aiConfigKey = process.env.LAUNCHDARKLY_AI_CONFIG_KEY || 'sample-ai-config';
99
const awsClient = new BedrockRuntimeClient({ region: 'us-east-1' });
1010

1111
if (!sdkKey) {

packages/sdk/server-ai/examples/bedrock/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "@tsconfig/node20/tsconfig.json",
33
"compilerOptions": {
4-
"noEmit": true,
4+
"noEmit": false,
55
"outDir": "dist",
66
"baseUrl": ".",
77
"allowUnusedLabels": false,

packages/sdk/server-ai/examples/openai/README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,20 @@
22

33
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.
44

5-
## Installation
5+
## Installation and Build
66

77
To install the package and its dependencies, run:
88

99
```bash
1010
npm install
1111
```
1212

13+
Then build the project:
14+
15+
```bash
16+
npm run build
17+
```
18+
1319
## Configuration
1420

1521
Before running the example, make sure to set the following environment variables:
@@ -32,7 +38,7 @@ The main script (`index.js`) demonstrates how to:
3238
To run the example:
3339

3440
```bash
35-
node index.js
41+
node dist/index.js
3642
```
3743

3844
## Note

packages/sdk/server-ai/examples/openai/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "@tsconfig/node20/tsconfig.json",
33
"compilerOptions": {
4-
"noEmit": true,
4+
"noEmit": false,
55
"outDir": "dist",
66
"baseUrl": ".",
77
"allowUnusedLabels": false,

packages/sdk/server-ai/src/LDAIClientImpl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Mustache from 'mustache';
1+
import * as Mustache from 'mustache';
22

33
import { LDClient, LDContext } from '@launchdarkly/node-server-sdk';
44

0 commit comments

Comments
 (0)