From 8c192acd7dd0441e0ad4634cfd5c490ccf232c55 Mon Sep 17 00:00:00 2001 From: Raven Scott Date: Fri, 7 Apr 2023 21:18:40 +0200 Subject: [PATCH] moving port to .env --- README.md | 2 ++ commands/system/chat.js | 2 +- commands/system/new-chat.js | 2 +- commands/system/view-session-history.js | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index acbae8d..829a656 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,8 @@ Message intents are NOT supported in this bot, this is due to the verification t TOKEN = (Discord Token) INTERNAL_IP = (The Internal IP Address of the Server running Serge) PUBLIC_URL = (The public URL of your Serge install) +SERGE_PORT = (The PORT of your Serge install) - DEFAULT: 8008 + ``` 4) Go into https://discord.com/developers/applications and enable Privileged Intents diff --git a/commands/system/chat.js b/commands/system/chat.js index c234039..128eb35 100644 --- a/commands/system/chat.js +++ b/commands/system/chat.js @@ -47,7 +47,7 @@ module.exports = { 'accept': 'text', }; console.log(session); - const response = await axios.post(`http://${process.env.INTERNAL_IP}:8008/api/chat/${sessionID}/question?prompt=${prompt}`, { + const response = await axios.post(`http://${process.env.INTERNAL_IP}:${process.env.SERGE_PORT}/api/chat/${sessionID}/question?prompt=${prompt}`, { headers }); diff --git a/commands/system/new-chat.js b/commands/system/new-chat.js index fef3868..c64b251 100644 --- a/commands/system/new-chat.js +++ b/commands/system/new-chat.js @@ -3,7 +3,7 @@ var unirest = require('unirest'); const jsonfile = require('jsonfile') // Start session defaults: -var apiUrl = `http://${process.env.INTERNAL_IP}:8008/api/chat/`; +var apiUrl = `http://${process.env.INTERNAL_IP}:${process.env.SERGE_PORT}/api/chat/`; var model = 'gpt4all'; var temperature = 0.1; diff --git a/commands/system/view-session-history.js b/commands/system/view-session-history.js index caaa034..63e8413 100644 --- a/commands/system/view-session-history.js +++ b/commands/system/view-session-history.js @@ -31,7 +31,7 @@ module.exports = { 'accept': 'text/event-stream', }; - const response = await axios.get(`http://${process.env.INTERNAL_IP}:8008/api/chat/${sessionID}`, { + const response = await axios.get(`http://${process.env.INTERNAL_IP}:${process.env.SERGE_PORT}/api/chat/${sessionID}`, { headers });