Skip to content

Instantly share code, notes, and snippets.

@antstanley
Created May 31, 2024 14:26
Show Gist options
  • Save antstanley/129b0bd552983707661d9f1db8be5e82 to your computer and use it in GitHub Desktop.
Save antstanley/129b0bd552983707661d9f1db8be5e82 to your computer and use it in GitHub Desktop.
Why use 27 lines when you can use 8
import { BedrockRuntimeClient, ConverseCommand } from "@aws-sdk/client-bedrock-runtime";
console.log((await new BedrockRuntimeClient({ region: 'us-east-1' }).send(new ConverseCommand({
modelId: "anthropic.claude-3-haiku-20240307-v1:0", messages: [{
role: "user",
content: [{ text: "Explain 'rubber duck debugging' in one line." }],
}]
}))).output.message.content[0].text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment