mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-04-28 11:40:47 +00:00
msg redesign wip
This commit is contained in:
parent
2fcc8ec885
commit
e15b959eee
8 changed files with 813 additions and 621 deletions
|
|
@ -119,4 +119,14 @@ def dict_to_text(d: dict) -> str:
|
|||
parts.append(f"{value}")
|
||||
parts.append("") # Add empty line between entries
|
||||
|
||||
return "\n".join(parts).rstrip() # rstrip to remove trailing newline
|
||||
return "\n".join(parts).rstrip() # rstrip to remove trailing newline
|
||||
|
||||
def truncate_text(text: str, length: int, at_end: bool = True, replacement: str = "...") -> str:
|
||||
orig_length = len(text)
|
||||
if orig_length <= length:
|
||||
return text
|
||||
if at_end:
|
||||
return text[:length] + replacement
|
||||
else:
|
||||
return replacement + text[-length:]
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue