fix: emit ErrorFrame on LLM completion timeout

This commit is contained in:
Luke Payyapilli
2026-01-28 09:42:22 -05:00
parent 06ec21387f
commit ff0eb6d286
3 changed files with 130 additions and 1 deletions

View File

@@ -492,8 +492,9 @@ 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)
finally:
await self.stop_processing_metrics()
await self.push_frame(LLMFullResponseEndFrame())