Skip to content

Commit

Permalink
initial wastebin configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
artifishvr committed May 19, 2024
1 parent 58d27cd commit a020cf0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@ CLOUDFLARE_ACCOUNT_TOKEN=v1.0-abcdef1234567890abcdef1234567890abcdef1234567890ab
# The following variables specify instruction sets and configuration for the various models in SpongeChat.
## The value of the variable should correspond to the key of its' responding configuration in modelConstants.js.
MODEL_LLM_PRESET=default

# !! Pastebin

WASTEBIN_HOST=https://localhost:8088
9 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ services:
- DFLY_snapshot_cron=*/30 * * * *
volumes:
- dragonflydata:/data
wastebin:
image: 'quxfoo/wastebin:latest'
environment:
- WASTEBIN_DATABASE_PATH=/data/state.db
volumes:
- wastebindata:/data
ports:
- "8088:8088"

volumes:
dragonflydata:
wastebindata:
22 changes: 15 additions & 7 deletions src/commands/forget.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ModelInteractions } from "../util/models/index.js";
import { fetch } from "undici";

/** @type {import('./index.js').Command} */
export default {
Expand Down Expand Up @@ -42,14 +43,21 @@ export default {
if (length === 0) return await interaction.editReply({ content: toSay });

try {
await interaction?.editReply({
content: toSay,
files: [
{
attachment: log,
name: "context.md",
const request = fetch(
`${process.env.WASTEBIN_HOST}/`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
],
body: JSON.stringify({
"text": log,
"extension": "md",
}),
},
)
await interaction?.editReply({
content: `${toSay}\n\n${process.env.WASTEBIN_HOST}${(await request.json()).path}`,
failIfNotExists: true,
});

Expand Down

0 comments on commit a020cf0

Please sign in to comment.