From 607e3040d47698e058150fbdfd74247c58e381af Mon Sep 17 00:00:00 2001 From: LucasStringPay <160168817+LucasStringPay@users.noreply.github.com> Date: Thu, 2 Oct 2025 15:16:11 -0700 Subject: [PATCH] Ignore None 'completion_tokens' or similar Similar as https://github.com/pipecat-ai/pipecat/commit/144ea36c81e0698163493e945a33d5b5b4ebd406 , reported in https://github.com/pipecat-ai/pipecat/issues/2207 --- src/pipecat/services/google/llm_openai.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pipecat/services/google/llm_openai.py b/src/pipecat/services/google/llm_openai.py index 81d124cb7..fde62154e 100644 --- a/src/pipecat/services/google/llm_openai.py +++ b/src/pipecat/services/google/llm_openai.py @@ -94,9 +94,9 @@ class GoogleLLMOpenAIBetaService(OpenAILLMService): async for chunk in chunk_stream: if chunk.usage: tokens = LLMTokenUsage( - prompt_tokens=chunk.usage.prompt_tokens, - completion_tokens=chunk.usage.completion_tokens, - total_tokens=chunk.usage.total_tokens, + prompt_tokens=chunk.usage.prompt_tokens or 0, + completion_tokens=chunk.usage.completion_tokens or 0, + total_tokens=chunk.usage.total_tokens or 0, ) await self.start_llm_usage_metrics(tokens)