From 27dabf5c043029f3dc7e15686d9da3cfcc579a3d Mon Sep 17 00:00:00 2001 From: Pratyush Shukla Date: Sat, 10 Aug 2024 22:22:06 +0530 Subject: [PATCH] minor fix for output tokens --- agentops/llm_tracker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agentops/llm_tracker.py b/agentops/llm_tracker.py index e2ed8968..623d0e2b 100644 --- a/agentops/llm_tracker.py +++ b/agentops/llm_tracker.py @@ -663,7 +663,7 @@ def handle_stream_chunk(chunk: Message): elif isinstance(chunk, RawContentBlockStopEvent): pass elif isinstance(chunk, RawMessageDeltaEvent): - self.llm_event.completion_tokens += chunk.message.usage.output_tokens + self.llm_event.completion_tokens = chunk.usage.output_tokens elif isinstance(chunk, RawMessageStopEvent): self.llm_event.completion = accumulated_delta self.llm_event.end_timestamp = get_ISO_time()