Skip to content

Repository Containing sample code to execute/call AWS Bedrock

Notifications You must be signed in to change notification settings

serverless-guru/bedrock-samples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS Bedrock NodeJS Code Samples

This repository is intended to provide sample code on how to execute/call AWS Bedrock with either the AWS SDK v3 or using langchain.

Usage

The samples are mostly self-contained and can be executed independently, readers should ensure to:

  1. Have AWS Bedrock & the Claude Instant v1 model enabled on their accounts
  2. Have the AWS credentials configured on their terminals
  3. Have Node JS installed
  4. Execute npm i to install the dependencies
  5. Replace the required variables with the correct information
  6. Run the desired sample with node <sample-file-name>.js

Note

Langchain examples that contain the word memory in the file name also require a DynamoDB table to be created. review the Official Documentation for further details on how this is expected to work.

The Bedrock Agent Example also requires the user to have configured a AWS Bedrock agent on their account beforehand.

Samples

Following is a list of the currently available provided samples.

AWS SDK v3

  • Basic Example: Sample of executing a single synchronous call to AWS Bedrock.
  • Streamed Response: Improvement of the first example to allow for receiving streamed responses from Bedrock.
  • Bedrock Agent: Sample code on how to trigger the execution of an existing Bedrock Agent.

Langchain

About

Repository Containing sample code to execute/call AWS Bedrock

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published