From 70191ffc1df99b4ae423a0e1934e6bb99aa9b2ba Mon Sep 17 00:00:00 2001 From: "David S. Batista" Date: Mon, 19 Aug 2024 10:03:22 +0200 Subject: [PATCH] reverting --- .../components/generators/amazon_bedrock/chat/chat_generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integrations/amazon_bedrock/src/haystack_integrations/components/generators/amazon_bedrock/chat/chat_generator.py b/integrations/amazon_bedrock/src/haystack_integrations/components/generators/amazon_bedrock/chat/chat_generator.py index 988452a97..04e564eb8 100644 --- a/integrations/amazon_bedrock/src/haystack_integrations/components/generators/amazon_bedrock/chat/chat_generator.py +++ b/integrations/amazon_bedrock/src/haystack_integrations/components/generators/amazon_bedrock/chat/chat_generator.py @@ -215,8 +215,8 @@ def run( if "output_tokens" in response.meta["usage"]: response.meta["usage"]["completion_tokens"] = response.meta["usage"].pop("output_tokens") else: - response.meta["usage"] = {} if "prompt_token_count" in response.meta: + response.meta["usage"] = {} response.meta["usage"]["prompt_tokens"] = response.meta.pop("prompt_token_count") if "generation_token_count" in response.meta: response.meta["usage"]["completion_tokens"] = response.meta.pop("generation_token_count")