MCPcopy
hub / github.com/langchain-ai/deepagents / _write_text

Function _write_text

libs/code/deepagents_code/non_interactive.py:94–105  ·  view source on GitHub ↗

Write agent response text to stdout (without a trailing newline). Uses `sys.stdout` directly (rather than the Rich Console) so that agent response text always appears on stdout, even in quiet mode where the Console is redirected to stderr. Args: text: The text string to wri

(text: str)

Source from the content-addressed store, hash-verified

92
93
94def _write_text(text: str) -> None:
95 """Write agent response text to stdout (without a trailing newline).
96
97 Uses `sys.stdout` directly (rather than the Rich Console) so that agent
98 response text always appears on stdout, even in quiet mode where the
99 Console is redirected to stderr.
100
101 Args:
102 text: The text string to write.
103 """
104 sys.stdout.write(text)
105 sys.stdout.flush()
106
107
108def _write_newline() -> None:

Callers 2

_process_ai_messageFunction · 0.85
_run_agent_loopFunction · 0.85

Calls 2

writeMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…