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 python/samples/core_async_human_in_the_loop/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ async def main(model_config: Dict[str, Any], latest_user_input: Optional[str] =

async def ainput(prompt: str = "") -> str:
with ThreadPoolExecutor(1, "AsyncInput") as executor:
return await asyncio.get_event_loop().run_in_executor(executor, input, prompt)
return await asyncio.get_running_loop().run_in_executor(executor, input, prompt)


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion python/samples/core_semantic_router/_agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ async def on_agent_message(self, message: WorkerAgentMessage, ctx: MessageContex

async def get_user_input(self, prompt: str) -> str:
"""Get user input from the console. Override this method to customize how user input is retrieved."""
loop = asyncio.get_event_loop()
loop = asyncio.get_running_loop()
return await loop.run_in_executor(None, input, prompt)