From 0ec8a452f9256021e38ce7556761c3130424fa15 Mon Sep 17 00:00:00 2001 From: Vic <125237471+vicsanity623@users.noreply.github.com> Date: Mon, 9 Mar 2026 18:53:15 -0700 Subject: [PATCH 1/2] Update core_utils.py --- src/pyob/core_utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pyob/core_utils.py b/src/pyob/core_utils.py index b2581b0..908822f 100644 --- a/src/pyob/core_utils.py +++ b/src/pyob/core_utils.py @@ -487,10 +487,10 @@ def get_valid_llm_response(self, prompt: str, validator, context: str = "") -> s # 3. Handle Empty or Error Responses (STOPS THE INFINITE LOOP) if not response_text or response_text.startswith("ERROR_CODE_"): - logger.warning( - "⚠️ API Error/Empty Response. Sleeping 10s before retry..." - ) - time.sleep(10) # MANDATORY SLEEP to prevent tight-looping + # If we are in the cloud, we need to wait longer for the token bucket to refill + wait_time = 60 if is_cloud else 10 + logger.warning(f"⚠️ API Error/Empty Response. Sleeping {wait_time}s to refill tokens...") + time.sleep(wait_time) attempts += 1 continue From cd4d6311f175fbdec9932874c21e662897a166e2 Mon Sep 17 00:00:00 2001 From: vicsanity623 <125237471+vicsanity623@users.noreply.github.com> Date: Tue, 10 Mar 2026 01:54:16 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=AA=84=20PyOB:=20Automated=20Lint=20&?= =?UTF-8?q?=20Format=20Fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pyob/core_utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pyob/core_utils.py b/src/pyob/core_utils.py index 908822f..9ee013d 100644 --- a/src/pyob/core_utils.py +++ b/src/pyob/core_utils.py @@ -489,8 +489,10 @@ def get_valid_llm_response(self, prompt: str, validator, context: str = "") -> s if not response_text or response_text.startswith("ERROR_CODE_"): # If we are in the cloud, we need to wait longer for the token bucket to refill wait_time = 60 if is_cloud else 10 - logger.warning(f"⚠️ API Error/Empty Response. Sleeping {wait_time}s to refill tokens...") - time.sleep(wait_time) + logger.warning( + f"⚠️ API Error/Empty Response. Sleeping {wait_time}s to refill tokens..." + ) + time.sleep(wait_time) attempts += 1 continue