Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/crewai/src/crewai/cli/memory_tui.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ async def _do_recall(self, query: str) -> None:
if self._selected_scope != "/"
else None
)
loop = asyncio.get_event_loop()
loop = asyncio.get_running_loop()
matches = await loop.run_in_executor(
None,
lambda: self._memory.recall(
Expand Down
2 changes: 1 addition & 1 deletion lib/crewai/src/crewai/tools/structured_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ async def ainvoke(
# Run sync functions in a thread pool
import asyncio

return await asyncio.get_event_loop().run_in_executor(
return await asyncio.get_running_loop().run_in_executor(
None, lambda: self.func(**parsed_args, **kwargs)
)
except Exception:
Expand Down
2 changes: 1 addition & 1 deletion lib/crewai/src/crewai/utilities/streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def create_streaming_state(

if use_async:
async_queue = asyncio.Queue()
loop = asyncio.get_event_loop()
loop = asyncio.get_running_loop()

handler = _create_stream_handler(current_task_info, sync_queue, async_queue, loop)
crewai_event_bus.register_handler(LLMStreamChunkEvent, handler)
Expand Down