Updates for v0.6

Main pack of updates:
- web ui
- knowledge import
- FAISS DB
- prompt subfolders
This commit is contained in:
frdel 2024-08-31 22:38:07 +02:00
parent 18a62c99d3
commit 9c258b77a2
59 changed files with 1759 additions and 393 deletions

View file

@ -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