Skip to content

Commit

Permalink
add more console logging to v2 api
Browse files Browse the repository at this point in the history
  • Loading branch information
crpietschmann committed Apr 30, 2024
1 parent 30f2df0 commit 02521ee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/nodejs/simple/api/v2.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ module.exports = (app) => {
const prompt = req.body.prompt;
if (!prompt) {
return res.status(400).send('Prompt is required');
}
}

console.info(`\n\nUser Prompt:\n${prompt}`);

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

console.info(`\n\nAI Response:\n${systemResponse}`);

//return res.json({ response: systemResponse });
return res.json(chatResponse);
} catch (error) {
Expand Down

0 comments on commit 02521ee

Please sign in to comment.