Skip to content

Commit 694fd6e

Browse files
committed
🐛 log fallback failures
1 parent c51c438 commit 694fd6e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

utils/llm/dspy_inference.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,11 @@ async def run(
112112
log.warning(
113113
f"Primary model unavailable; falling back to {self.fallback_model_name}"
114114
)
115-
result = await self._run_with_retry(self.fallback_lm, **kwargs)
115+
try:
116+
result = await self._run_with_retry(self.fallback_lm, **kwargs)
117+
except (RateLimitError, ServiceUnavailableError) as fallback_error:
118+
log.error(f"Fallback model failed: {fallback_error.__class__.__name__}")
119+
raise
116120
except (RuntimeError, ValueError, TypeError) as e:
117121
log.error(f"Error in run: {str(e)}")
118122
raise

0 commit comments

Comments
 (0)