From 3615b7dde28895df6a11d7372007053b424f30c8 Mon Sep 17 00:00:00 2001 From: Soulter <37870767+Soulter@users.noreply.github.com> Date: Mon, 5 Jan 2026 17:06:12 +0800 Subject: [PATCH] fix: token usage is always 0 in anthropic source (#4328) --- astrbot/core/provider/entities.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/astrbot/core/provider/entities.py b/astrbot/core/provider/entities.py index a02874c04..a1a6039f4 100644 --- a/astrbot/core/provider/entities.py +++ b/astrbot/core/provider/entities.py @@ -344,6 +344,11 @@ class LLMResponse: self.raw_completion = raw_completion self.is_chunk = is_chunk + if id is not None: + self.id = id + if usage is not None: + self.usage = usage + @property def completion_text(self): if self.result_chain: