Skip to content

Commit 02521ee

Browse files
committed
add more console logging to v2 api
1 parent 30f2df0 commit 02521ee

File tree

1 file changed

+5
-1
lines changed
  • app/nodejs/simple/api

1 file changed

+5
-1
lines changed

app/nodejs/simple/api/v2.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ module.exports = (app) => {
5757
const prompt = req.body.prompt;
5858
if (!prompt) {
5959
return res.status(400).send('Prompt is required');
60-
}
60+
}
61+
62+
console.info(`\n\nUser Prompt:\n${prompt}`);
6163

6264
// Add the user's prompt to the conversation history
6365
appendConversationHistory("user", prompt);
@@ -98,6 +100,8 @@ module.exports = (app) => {
98100
const systemResponse = chatResponse.choices[0].message.content;
99101
appendConversationHistory("assistant", systemResponse, chatResponse);
100102

103+
console.info(`\n\nAI Response:\n${systemResponse}`);
104+
101105
//return res.json({ response: systemResponse });
102106
return res.json(chatResponse);
103107
} catch (error) {

0 commit comments

Comments
 (0)