Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Sample AWS Bedrock Application

This application tests instrumentation of @langchain/aws, specifically LangChain's interaction with AWS Bedrock Converse classes and methods.

Getting started

Note: This application requires the use of Node.js v20+.

  1. Clone or fork this repository.
  2. Install dependencies and run application
npm i
cp .env.sample .env
# Fill out `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and `NEW_RELIC_LICENSE_KEY` in .env. Save your changes.
npm start
  1. Make requests to application.
# chat completions
curl -XPOST -H 'Content-Type: application/json' http://localhost:3000/chat-invoke -d '{"message":"How much wood could a woodchuck chuck if a woodchuck could chuck wood?", "model": "us.amazon.nova-micro-v1:0"}'

# chat completions stream
curl -XPOST -H 'Content-Type: application/json' http://localhost:3000/chat-stream -d '{"message":"Explain the rules of jai alai", "model": "us.amazon.nova-micro-v1:0"}'

# embedding with vector search
curl -XPOST -H 'Content-type: application/json' http://localhost:3000/embedding -d '{"message":"Test embedding", "model": "amazon.titan-embed-text-v1"}'