MCPcopy Create free account
hub / github.com/VectifyAI/OpenKB / _stream_to_tty

Function _stream_to_tty

openkb/cli.py:1080–1088  ·  view source on GitHub ↗

Return True when stdout is a real terminal. Used to auto-disable streaming output when ``openkb query`` is piped, redirected to a file, or run as a subprocess — streaming output emits interleaved tool-call lines that are noisy for non-interactive callers, and the non-streaming branc

()

Source from the content-addressed store, hash-verified

1078
1079
1080def _stream_to_tty() -> bool:
1081 """Return True when stdout is a real terminal.
1082
1083 Used to auto-disable streaming output when ``openkb query`` is piped,
1084 redirected to a file, or run as a subprocess — streaming output emits
1085 interleaved tool-call lines that are noisy for non-interactive callers,
1086 and the non-streaming branch returns just the final answer string.
1087 """
1088 return sys.stdout.isatty()
1089
1090
1091@cli.command()

Callers 1

queryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected