Skip to content

Agent Zero AI framework

toast fix

frdel6aa37744fc9c
diff --git a/webui/index.js b/webui/index.js
index 019cc3ff2..5c5b56fab 100644
--- a/webui/index.js
+++ b/webui/index.js
@@ -263,6 +263,7 @@ window.loadKnowledge = async function () {
input.multiple = true;
input.onchange = async () => {
+ try{
const formData = new FormData();
for (let file of input.files) {
formData.append('files[]', file);
@@ -279,6 +280,9 @@ window.loadKnowledge = async function () {
const data = await response.json();
toast("Knowledge files imported: " + data.filenames.join(", "), "success");
}
+ } catch (e) {
+ toastFetchError("Error loading knowledge", e)
+ }
};
input.click();
diff --git a/webui/js/history.js b/webui/js/history.js
index 1afb48f20..cd0b56d75 100644
--- a/webui/js/history.js
+++ b/webui/js/history.js
@@ -3,26 +3,25 @@ import { getContext } from "../index.js";
export async function openHistoryModal() {
try {
const hist = await window.sendJsonData("/history_get", { context: getContext() });
+ const data = JSON.stringify(hist.history, null, 4);
+ const size = hist.tokens
+ await showEditorModal(data, "json", `History ~${size} tokens`, "Conversation history visible to the LLM. History is compressed to fit into the context window over time.");
} catch (e) {
window.toastFetchError("Error fetching history", e)
return
}
- const data = JSON.stringify(hist.history, null, 4);
- const size = hist.tokens
- await showEditorModal(data, "json", `History ~${size} tokens`, "Conversation history visible to the LLM. History is compressed to fit into the context window over time.");
-
}
export async function openCtxWindowModal() {
try {
const win = await window.sendJsonData("/ctx_window_get", { context: getContext() });
+ const data = win.content
+ const size = win.tokens
+ await showEditorModal(data, "markdown", `Context window ~${size} tokens`, "Data passed to the LLM during last interaction. Contains system message, conversation history and RAG.");
} catch (e) {
window.toastFetchError("Error fetching context", e)
return
}
- const data = win.content
- const size = win.tokens
- await showEditorModal(data, "markdown", `Context window ~${size} tokens`, "Data passed to the LLM during last interaction. Contains system message, conversation history and RAG.");
}
async function showEditorModal(data, type = "json", title, description = "") {