Merge pull request #3529 from lukepayyapilli/fix/llm-timeout-without-retry

feat: handle exceptions for BaseOpenAILLMService
This commit is contained in:
Mark Backman
2026-01-29 09:12:54 -05:00
committed by GitHub
3 changed files with 168 additions and 1 deletions

View File

@@ -492,8 +492,11 @@ class BaseOpenAILLMService(LLMService):
await self.push_frame(LLMFullResponseStartFrame())
await self.start_processing_metrics()
await self._process_context(context)
except httpx.TimeoutException:
except httpx.TimeoutException as e:
await self._call_event_handler("on_completion_timeout")
await self.push_error(error_msg="LLM completion timeout", exception=e)
except Exception as e:
await self.push_error(error_msg=f"Error during completion: {e}", exception=e)
finally:
await self.stop_processing_metrics()
await self.push_frame(LLMFullResponseEndFrame())