Fix issue #2487: Ensure LLM errors are properly raised in async context

Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
Devin AI
2025-03-27 09:28:27 +00:00
parent e1a73e0c44
commit 7907c8a147
2 changed files with 35 additions and 1 deletions

View File

@@ -684,7 +684,10 @@ class Crew(BaseModel):
async def kickoff_async(self, inputs: Optional[Dict[str, Any]] = {}) -> CrewOutput:
"""Asynchronous kickoff method to start the crew execution."""
return await asyncio.to_thread(self.kickoff, inputs)
try:
return await asyncio.to_thread(self.kickoff, inputs)
except Exception as e:
raise
async def kickoff_for_each_async(self, inputs: List[Dict]) -> List[CrewOutput]:
crew_copies = [self.copy() for _ in inputs]