mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-05-01 21:20:33 +00:00
Updates for v0.6
Main pack of updates: - web ui - knowledge import - FAISS DB - prompt subfolders
This commit is contained in:
parent
18a62c99d3
commit
9c258b77a2
59 changed files with 1759 additions and 393 deletions
|
|
@ -1,12 +1,12 @@
|
|||
from . import files
|
||||
# from . import files
|
||||
|
||||
|
||||
def truncate_text(output, threshold=1000):
|
||||
def truncate_text(agent, output, threshold=1000):
|
||||
if len(output) <= threshold:
|
||||
return output
|
||||
|
||||
# Adjust the file path as needed
|
||||
placeholder = files.read_file("./prompts/fw.msg_truncated.md", removed_chars=(len(output) - threshold))
|
||||
placeholder = agent.read_prompt("fw.msg_truncated.md", removed_chars=(len(output) - threshold))
|
||||
# placeholder = files.read_file("./prompts/default/fw.msg_truncated.md", removed_chars=(len(output) - threshold))
|
||||
|
||||
start_len = (threshold - len(placeholder)) // 2
|
||||
end_len = threshold - len(placeholder) - start_len
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue