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
We recently added
TokenCountersto Haystack 3.1 in PR deepset-ai/haystack#12195Token Counter Docs: https://docs.haystack.deepset.ai/docs/token-counters
We should also add a
AmazonBedrockTokenCounterto our amazon-bedrock integration using their token counting endpoint https://docs.aws.amazon.com/bedrock/latest/userguide/count-tokens.htmlWe can follow the implementation of the
OpenAITokenCounterhttps://github.com/deepset-ai/haystack/blob/main/haystack/token_counters/openai_counter.py as inspiration