From e36bc352d6c70ca0f6904f0e954ee0083c56b6e9 Mon Sep 17 00:00:00 2001 From: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com> Date: Tue, 5 Nov 2024 15:42:40 -0800 Subject: [PATCH] Update example readme files. --- .../sdk/server-ai/examples/bedrock/README.md | 15 +++++++++------ .../server-ai/examples/bedrock/package.json | 1 + .../sdk/server-ai/examples/openai/README.md | 18 +++++++++++------- .../sdk/server-ai/examples/openai/package.json | 1 + 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/packages/sdk/server-ai/examples/bedrock/README.md b/packages/sdk/server-ai/examples/bedrock/README.md index 1e383ec9f..a997129f8 100644 --- a/packages/sdk/server-ai/examples/bedrock/README.md +++ b/packages/sdk/server-ai/examples/bedrock/README.md @@ -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 @@ -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 ``` diff --git a/packages/sdk/server-ai/examples/bedrock/package.json b/packages/sdk/server-ai/examples/bedrock/package.json index 9f186cd87..a99a3cc99 100644 --- a/packages/sdk/server-ai/examples/bedrock/package.json +++ b/packages/sdk/server-ai/examples/bedrock/package.json @@ -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", diff --git a/packages/sdk/server-ai/examples/openai/README.md b/packages/sdk/server-ai/examples/openai/README.md index 86f9eab93..0126c332a 100644 --- a/packages/sdk/server-ai/examples/openai/README.md +++ b/packages/sdk/server-ai/examples/openai/README.md @@ -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 @@ -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. \ No newline at end of file +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. diff --git a/packages/sdk/server-ai/examples/openai/package.json b/packages/sdk/server-ai/examples/openai/package.json index 02058b5a4..6fc069296 100644 --- a/packages/sdk/server-ai/examples/openai/package.json +++ b/packages/sdk/server-ai/examples/openai/package.json @@ -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",