0

I am a newbie to using JavaScript SDK to connect to AWS Bedrock service, below is my code:

const { BedrockAgentRuntimeClient, RetrieveCommand } = require("@aws-sdk/client-bedrock-agent-runtime");


const client = new BedrockAgentRuntimeClient({
// fake credentials
    credentials: {
      accessKeyId: 'accesskey',
      secretAccessKey: 'secret',
    },
    region: "us-east-1"
});
  
const params = {
/** input parameters */
};

const command = new RetrieveCommand(params);

async function send() {
    const data = await client.send(command);

}

send();
  

In this code, what do I need to pass in params section? And, am I missing something from the code?

I searched the documentation a lot but found nothing.

Any help will be appreciated.

7
  • 1
    Never ever out valid credentials in a public forum like that. People harvest these and abuse them. Commented Jul 19, 2024 at 6:29
  • Which documentation did you read? This one? docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/… Commented Jul 19, 2024 at 9:06
  • @SAE No, this one: github.com/aws/aws-sdk-js-v3/tree/main/clients/… Commented Jul 19, 2024 at 9:18
  • @SAE Also I want to chat with Bedrock agent, not the knowledgebase, because the agent has some action groups (lambda functions), that I need to be invoked. Commented Jul 19, 2024 at 9:39
  • "your" documentation leeds to the specific docs about the RetrieveCommand... So, that should answer your general question, what params expects. Commented Jul 19, 2024 at 10:29

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.