mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 04:39:31 +08:00
Ship a content workspace you choose, one exec tool for every language, Mastery Path modes that gate its tools, and Settings that grades readiness instead of listing faults. Release notes: assets/releases/ver1-6-5.md
15 lines
375 B
Python
15 lines
375 B
Python
"""Shared text shaping for the notebook agents."""
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
def clip_text(value: str, limit: int) -> str:
|
|
"""Trim prose to *limit* characters, saying so when anything was cut."""
|
|
text = str(value or "").strip()
|
|
if len(text) <= limit:
|
|
return text
|
|
return text[:limit].rstrip() + "\n...[truncated]"
|
|
|
|
|
|
__all__ = ["clip_text"]
|