Compare commits

...

2 Commits

Author SHA1 Message Date
Raven Scott 779ac1f462 Moving REFRESH_INTERVAL to docker-compose 2023-05-02 14:16:13 +02:00
Raven Scott 335b01287e Moving REFRESH_INTERVAL to .env 2023-05-02 14:15:45 +02:00
3 changed files with 6 additions and 2 deletions

View File

@ -7,6 +7,9 @@ CACHE = 1
N_THREADS = 4
MAX_TOKENS = 1024
# Bot specific settings
REFRESH_INTERVAL=7
# ROOT_IP is only used when running the bot without docker compose
ROOT_IP = 192.168.0.15

View File

@ -21,6 +21,7 @@ services:
- llama-python-server
environment:
- THE_TOKEN
- REFRESH_INTERVAL
- CHANNEL_IDS
- ROOT_IP=llama-python-server
- ROOT_PORT=8000

View File

@ -241,8 +241,8 @@ async function generateResponse(conversation, message) {
// call the function initially
await showSystemLoad();
// refresh the system load percentage and update the message every 7 seconds
const refreshInterval = setInterval(showSystemLoad, 7000);
// Grab the REFRESH_INTERVAL from ENV if not exist, lets use 7 (seconds)
const refreshInterval = setInterval(showSystemLoad, (process.env.REFRESH_INTERVAL || 7) * 1000);
try {
const response = await fetch(`http://${process.env.ROOT_IP}:${process.env.ROOT_PORT}/v1/chat/completions`, {