Skip to content

Commit

Permalink
Add callouts for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
Grigin committed Feb 29, 2024
1 parent 763e7b8 commit 1664b69
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion functions/respond.protected.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,33 @@ export async function handler (context, event, callback) {
"asst_WXd3r3pRZkaC7Q2k7X8DtKh4",
);

const callThread = await openai.beta.threads.create();
twiml_response.say({
voice: "Polly.Joanna-Neural",
},
"Initialised assistant"
);

const callThread = await openai.beta.threads.create({
messages: [
{
"role": "user",
"content": "Hello HillindonLex.",
}
]
});

twiml_response.say({
voice: "Polly.Joanna-Neural",
},
"Initialised assistant"
);

twiml_response.say({
voice: "Polly.Joanna-Neural",
},
callThread.id
);

const logFileName = decodeURIComponent(event.request.cookies.logFileName)

const userLog = {
Expand All @@ -35,6 +61,12 @@ export async function handler (context, event, callback) {
};

conversation.push(userLog);

twiml_response.say({
voice: "Polly.Joanna-Neural",
},
"Pushed new message"
);
await addMessageToThread(callThread.id, userLog);

// const aiResponse = await generateAIResponse(conversation);
Expand Down

0 comments on commit 1664b69

Please sign in to comment.