Skip to content

Commit

Permalink
move from wastebin to custom viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
artifishvr committed May 25, 2024
1 parent eee6dd8 commit 846e6df
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
9 changes: 5 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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=
10 changes: 5 additions & 5 deletions src/commands/forget.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 846e6df

Please sign in to comment.