Skip to content

feat: Add AmazonBedrockTokenCounter to amazon-bedrock integration #3858

Description

@sjrl

We recently added TokenCounters to Haystack 3.1 in PR deepset-ai/haystack#12195

Token Counter Docs: https://docs.haystack.deepset.ai/docs/token-counters

We should also add a AmazonBedrockTokenCounter to our amazon-bedrock integration using their token counting endpoint https://docs.aws.amazon.com/bedrock/latest/userguide/count-tokens.html

We can follow the implementation of the OpenAITokenCounter https://github.com/deepset-ai/haystack/blob/main/haystack/token_counters/openai_counter.py as inspiration

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions