newrelic / node-newrelic

New Relic Node.js agent code base. Developers are welcome to create pull requests here, please see our contributing guidelines. For New Relic technical support, please go to http://support.newrelic.com.
Apache License 2.0
971 stars 399 forks source link

Nr-326020 Found bug - solution - fixes shape of user prompt #2739

Closed cmcadams-newrelic closed 1 week ago

cmcadams-newrelic commented 1 week ago

Description

The shape of the users prompt message was incorrect for claude 3.5

 // Prepare the payload for the model.
  const payload = {
    anthropic_version: "bedrock-2023-05-31",
    max_tokens: 1000,
    messages: [
      {
        role: "user",
        content: [{ type: "text", text: prompt }],
      },
    ],
  };

https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/javascript_bedrock-runtime_code_examples.html#anthropic_claude

How to Test

run unit test suite.

Related Issues