Skip to content

Commit

Permalink
Update example readme files.
Browse files Browse the repository at this point in the history
  • Loading branch information
kinyoklion committed Nov 5, 2024
1 parent 3c5780c commit e36bc35
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 13 deletions.
15 changes: 9 additions & 6 deletions packages/sdk/server-ai/examples/bedrock/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ This package demonstrates the integration of LaunchDarkly's AI SDK with AWS Bedr

## Installation and Build

To install the package and its dependencies, run:
When running as part of the js-core mono-repo the project will use local dependencies.
As such those dependencies need built.

In the root of the repository run:

```bash
npm install
yarn
```

Then build the project:
And then

```bash
npm run build
yarn build
```

## Configuration
Expand All @@ -36,8 +39,8 @@ The main script (`index.js`) demonstrates how to:
5. Send a prompt to AWS Bedrock
6. Track token usage

To run the example:
To run the example (in the bedrock directory):

```bash
node dist/index.js
yarn start
```
1 change: 1 addition & 0 deletions packages/sdk/server-ai/examples/bedrock/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"type": "commonjs",
"scripts": {
"build": "tsc",
"start": "yarn build && node ./dist/index.js",
"lint": "npx eslint . --ext .ts",
"prettier": "prettier --write '**/*.@(js|ts|tsx|json|css)' --ignore-path ../../../.prettierignore",
"lint:fix": "yarn run lint --fix",
Expand Down
18 changes: 11 additions & 7 deletions packages/sdk/server-ai/examples/openai/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@ This package demonstrates the integration of LaunchDarkly's AI SDK with OpenAI,

## Installation and Build

To install the package and its dependencies, run:

When running as part of the js-core mono-repo the project will use local dependencies.
As such those dependencies need built.

In the root of the repository run:

```bash
npm install
yarn
```

Then build the project:
And then

```bash
npm run build
yarn build
```

## Configuration
Expand All @@ -35,12 +39,12 @@ The main script (`index.js`) demonstrates how to:
5. Send a prompt to OpenAI
6. Track token usage

To run the example:
To run the example (in the openai directory):

```bash
node dist/index.js
yarn start
```

## Note

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.
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.
1 change: 1 addition & 0 deletions packages/sdk/server-ai/examples/openai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"types": "dist/index.d.ts",
"scripts": {
"build": "tsc",
"start": "yarn build && node ./dist/index.js",
"lint": "npx eslint . --ext .ts",
"prettier": "prettier --write '**/*.@(js|ts|tsx|json|css)' --ignore-path ../../../.prettierignore",
"lint:fix": "yarn run lint --fix",
Expand Down

0 comments on commit e36bc35

Please sign in to comment.