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

Function _fmt

openkb/agent/chat.py:85–96  ·  view source on GitHub ↗
(style: Style, *fragments: tuple[str, str])

Source from the content-addressed store, hash-verified

83
84
85def _fmt(style: Style, *fragments: tuple[str, str]) -> None:
86 # prompt_toolkit's print_formatted_text constructs a Win32Output on
87 # Windows that requires a real console handle, raising
88 # NoConsoleScreenBufferError when stdout is a pipe, file, or captured
89 # subprocess stream. Fall back to plain text when the output isn't a
90 # usable console.
91 if not _use_color(force_off=False):
92 for _, text in fragments:
93 sys.stdout.write(text)
94 sys.stdout.flush()
95 return
96 print_formatted_text(FormattedText(list(fragments)), style=style, end="")
97
98
99def _format_tool_line(name: str, args: str, width: int = 78) -> str:

Callers 10

run_queryFunction · 0.90
_print_headerFunction · 0.85
_print_resume_viewFunction · 0.85
_run_turnFunction · 0.85
_run_addFunction · 0.85
_handle_slash_skillFunction · 0.85
_handle_slash_deckFunction · 0.85
_handle_slashFunction · 0.85
_handle_slash_critiqueFunction · 0.85
run_chatFunction · 0.85

Calls 2

_use_colorFunction · 0.85
writeMethod · 0.80

Tested by

no test coverage detected