better name for session ID where needed and better formatting

This commit is contained in:
Raven Scott
2023-03-26 02:27:33 +02:00
parent f34805479d
commit ebf1d675f1
2 changed files with 9 additions and 9 deletions

View File

@ -1,6 +1,6 @@
const axios = require('axios');
const jsonfile = require('jsonfile');
let session2;
let sessionID;
function parseQuestionsAndAnswers(jsonStr) {
const obj = JSON.parse(jsonStr);
@ -19,9 +19,9 @@ module.exports = {
if (err) return interaction.editReply('Please create a session using /create-session.');
session2 = session.id;
sessionID = session.id;
if (!session2) {
if (!sessionID) {
console.log("No Session!");
isProcessing = false;
return;
@ -30,7 +30,7 @@ module.exports = {
'authority': process.env.PUBLIC_URL,
'accept': 'text/event-stream',
};
const response = await axios.get(`http://${process.env.INTERNAL_IP}:8008/api/chat/` + session2, {
const response = await axios.get(`http://${process.env.INTERNAL_IP}:8008/api/chat/${sessionID}`, {
headers,
auth: {
username: process.env.USERNAME,