mirror of
https://github.com/wasnertobias/StalkingAId.git
synced 2025-10-16 11:55:43 +00:00
More intense logging
This commit is contained in:
parent
1b43cee981
commit
71272151bb
@ -7,17 +7,15 @@ const app = express();
|
||||
app.use(cors({
|
||||
origin: 'https://stalkingaid.org'
|
||||
}));
|
||||
|
||||
|
||||
// support parsing of application/json type post data
|
||||
app.use(bodyParser.json());
|
||||
|
||||
//support parsing of application/x-www-form-urlencoded post data
|
||||
app.use(bodyParser.urlencoded({ extended: true }));
|
||||
|
||||
app.route("/api/chat").post((req, res) => {
|
||||
const {token, history} = req.body;
|
||||
|
||||
console.log(req.body);
|
||||
|
||||
if (token !== process.env.ACCESS_TOKEN) {
|
||||
return;
|
||||
}
|
||||
@ -66,6 +64,7 @@ async function getResponse(history, res) {
|
||||
|
||||
// history: {msg: string, ai: boolean}[]
|
||||
const prompt = staticPrefix + '\n' + history.map(hist => hist.msg).join("\n");
|
||||
console.log("prompt: " + prompt);
|
||||
|
||||
try {
|
||||
const response = await openai.createCompletion({
|
||||
|
||||
Loading…
Reference in New Issue
Block a user