Skip to content

Commit 8426f73

Browse files
authored
Add error logging for validation failures
Log the AI response text when validation fails.
1 parent 8a96cd9 commit 8426f73

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/pyob/models.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,10 @@ def get_valid_llm_response_engine(
381381

382382
# If still invalid, back off and retry
383383
wait = 300 if is_cloud else 10
384+
385+
# --- ADD THIS LINE SO YOU CAN SEE WHAT IT FAILED ON ---
386+
logger.error(f"Validation Failed! The AI said: '{response_text}'")
387+
384388
logger.warning(f"AI response failed validation. Backing off {wait}s...")
385389
time.sleep(wait)
386390
attempts += 1

0 commit comments

Comments
 (0)