MCPcopy
hub / github.com/openai/openai-python / rich_print_str

Function rich_print_str

tests/utils.py:160–167  ·  tests/utils.py::rich_print_str

Like `rich.print()` but returns the string instead

(obj: object)

Source from the content-addressed store, hash-verified

158
159
160def rich_print_str(obj: object) -> str:
161 class="st">""class="st">"Like `rich.print()` but returns the string instead"class="st">""
162 buf = io.StringIO()
163
164 console = rich.console.Console(file=buf, width=120)
165 console.print(obj)
166
167 return buf.getvalue()
168
169
170@contextlib.contextmanager

Callers 3

print_objFunction · 0.85

Calls

no outgoing calls