From 851284b0a319131cc6a980303eab8dea88b28844 Mon Sep 17 00:00:00 2001 From: goulustis Date: Sat, 28 Feb 2026 10:59:24 +0800 Subject: [PATCH] comment out sleep --- lang_agent/dummy/calculator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lang_agent/dummy/calculator.py b/lang_agent/dummy/calculator.py index 566050d..3f72834 100644 --- a/lang_agent/dummy/calculator.py +++ b/lang_agent/dummy/calculator.py @@ -34,13 +34,14 @@ class Calculator(LangToolBase): def calculator(self, python_expression: str) -> dict: """For mathamatical calculation, always use this tool to calculate the result of a python expression. You can use 'math' or 'random' directly, without 'import'.""" + # time.sleep(20) result = eval(python_expression, {"math": math, "random": random}) return {"success": True, "result": result} async def calculator_async(self, python_expression: str) -> dict: """Async version: runs eval in a thread pool to avoid blocking the event loop.""" async with get_semaphore(): - await asyncio.sleep(5) # Simulate delay for testing + # await asyncio.sleep(20) # Simulate delay for testing result = await asyncio.to_thread( eval, python_expression, {"math": math, "random": random} )