From 846e6df511a3b81bd498f004d5323e627fc3d008 Mon Sep 17 00:00:00 2001 From: Arti <59352535+artifishvr@users.noreply.github.com> Date: Fri, 24 May 2024 20:56:06 -0700 Subject: [PATCH] move from wastebin to custom viewer --- .env.example | 9 +++++---- src/commands/forget.js | 10 +++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.env.example b/.env.example index 5d51142..f39d81f 100644 --- a/.env.example +++ b/.env.example @@ -50,8 +50,9 @@ CLOUDFLARE_ACCOUNT_TOKEN=v1.0-abcdef1234567890abcdef1234567890abcdef1234567890ab ## The value of the variable should correspond to the key of its' responding configuration in modelConstants.js. MODEL_LLM_PRESET=default -# !! Wastebin +# !! Memory-viewer (pathways-web) # Used to display logs of memories for users -## In a docker-compose setup, you'll need to set up some sort of proxy (caddy, cloudflare tunnel) to make the "wastebin" container publicly accessible, and put the publicly accessible URL here. - -WASTEBIN_HOST=http://127.0.0.1:8088 +## You'll need to host your own version of https://github.com/spongedsc/pathways-web, and use the same key here. +## The host should NOT have a trailing slash. +MEMVIEW_HOST= +MEMVIEW_KEY= diff --git a/src/commands/forget.js b/src/commands/forget.js index f422e6d..3197504 100644 --- a/src/commands/forget.js +++ b/src/commands/forget.js @@ -45,25 +45,25 @@ export default { try { const request = await fetch( - `${process.env.WASTEBIN_HOST}/`, + `${process.env.MEMVIEW_HOST}/create`, { method: "POST", headers: { "Content-Type": "application/json", + "Authorization": `Bearer ${process.env.MEMVIEW_KEY}`, }, body: JSON.stringify({ - text: log.toString("utf-8"), - extension: "md", + content: log.toString("utf-8"), }), }, ).catch((e) => { - console.error("Error uploading logs to wastebin: " + e); + console.error("Error uploading logs to memory viewer: " + e); return false; }); const button = new ButtonBuilder() .setLabel('View cleared memories') - .setURL(request !== false ? `${process.env.WASTEBIN_HOST}${(await request.json()).path}` : 'https://blahaj.ca/') + .setURL(request !== false ? `${process.env.MEMVIEW_HOST}/${(await request.json()).id}` : 'https://blahaj.ca/') .setStyle(ButtonStyle.Link); await interaction?.editReply({