Skip to content

Commit c1d29ee

Browse files
committed
Remove redundant stdouts
1 parent 033b63e commit c1d29ee

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

apex/services/deep_research/deep_research_langchain.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import asyncio
2+
import contextlib
23
from typing import Any
34

45
import tenacity
@@ -272,7 +273,8 @@ async def invoke(
272273
else:
273274
try:
274275
# PythonREPL returns only printed output (may include trailing newline)
275-
repl_output = self.python_repl.run(code)
276+
with contextlib.redirect_stdout(None):
277+
repl_output = self.python_repl.run(code)
276278
observation_text = repl_output if repl_output else "(no output)"
277279
logger.debug(f"Code execution result:\n{observation_text}")
278280
except Exception as e: # noqa: BLE001

0 commit comments

Comments
 (0)