We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c51c438 commit 694fd6eCopy full SHA for 694fd6e
1 file changed
utils/llm/dspy_inference.py
@@ -112,7 +112,11 @@ async def run(
112
log.warning(
113
f"Primary model unavailable; falling back to {self.fallback_model_name}"
114
)
115
- result = await self._run_with_retry(self.fallback_lm, **kwargs)
+ 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
120
except (RuntimeError, ValueError, TypeError) as e:
121
log.error(f"Error in run: {str(e)}")
122
raise
0 commit comments