Helicone Community Page

Updated 5 months ago

Helicone Async Logger and Anthropic Bedrock SDK Compatibility

hey team, when trying to use HeliconeAsyncLogger, it seems like helicone doesn't support the anthropic bedrock sdk from @anthropic-ai/bedrock-sdk?
Attachment
Screenshot_2024-08-07_at_2.39.35_PM.png
y
1 comment
Hey Bereket. You can use the Manual logger for capturing calls to berock.

The only difference is that you need to register the request and send the logs manually. And some helicone features may not work.

Eg:
Plain Text
import { HeliconeManualLogger } from "@helicone/helicone";
import * as bedrock from "@aws-sdk/client-bedrock-runtime";

import util from "util";

const logger = new HeliconeManualLogger({
  apiKey: process.env.HELICONE_PROD_KEY,
});

const client = new bedrock.BedrockRuntimeClient({
  credentials: {
    accessKeyId: "...",
    secretAccessKey: "...",
  },
  region: "us-east-1",
});

const input = { // ConverseRequest
  modelId: "meta.llama2-13b-chat-v1",
  messages: [
    {
      role: "user",
      content: [
        {
          text: "Hello wold, how are you doing?",
        },
      ],
    },
  ],
};

logger.registerRequest(input);

const command = new bedrock.ConverseCommand(input);
const response = await client.send(command);

console.log(util.inspect(response, { depth: null }));
logger.sendLog(response)
Add a reply
Sign up and join the conversation on Discord