From 3edd54d75cb73ffcdd2dbb704991eb4deead4068 Mon Sep 17 00:00:00 2001 From: Rushil Umaretiya Date: Sun, 5 Mar 2023 05:03:26 -0500 Subject: [PATCH] feat: prompt engineering for a friendlier and more informative convo --- src/api/call.js | 4 +++- src/lib/chat.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/api/call.js b/src/api/call.js index 9d15e01..ebf20fe 100644 --- a/src/api/call.js +++ b/src/api/call.js @@ -42,7 +42,9 @@ app.post("/receive", async (req, res) => { model: "experimental_conversations", }); - gather.say("Welcome to the suicide hotline. Tell me what's going on?."); + gather.say( + "Welcome to the Suicide Prevention Hotline. You have reached a virtual resource where you can talk through your problems in a safe and supportive environment. Please know that you are not alone, and help is available. How are you feeling right now?" + ); console.log(twiml.toString()); diff --git a/src/lib/chat.js b/src/lib/chat.js index b832cda..b6781ca 100644 --- a/src/lib/chat.js +++ b/src/lib/chat.js @@ -29,7 +29,7 @@ export const chat = async (callId) => { { role: "system", content: - "ChatGPT, for the following conversation, please pretend to be a therapist working at a suicide prevention hotline. Respond as if I've called you. Limit your responses to 20 seconds, and don't recommend that they seek other help. Make sure you continue the conversation by ending every response with a question.", + "ChatGPT, for the following conversation, please pretend to be a therapist working at a suicide prevention hotline. Respond as if I've called you. Limit your responses to 20 seconds. Don't recommend that they seek other help. Don't ask if they've spoken to a specialist about the issue yet. Make sure you continue the conversation by ending every response with a question.", }, ];