From ecdd45b638b046edfb275a653c35970b8f93a70a Mon Sep 17 00:00:00 2001 From: Rushil Umaretiya Date: Sat, 4 Mar 2023 21:56:03 -0500 Subject: [PATCH] chore: chatjs formatting --- src/chat.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/chat.js b/src/chat.js index 16b8699..9202b78 100644 --- a/src/chat.js +++ b/src/chat.js @@ -11,15 +11,15 @@ const configuration = new Configuration({ const openai = new OpenAIApi(configuration); const convertRole = (role) => { - switch(role){ + switch (role) { case Role.BOT: - return "assistant" + return "assistant"; case Role.USER: - return "user" + return "user"; default: - return "user" + return "user"; } -} +}; export const chat = async (callId) => { const msgs = await getMessages(callId); @@ -38,12 +38,12 @@ export const chat = async (callId) => { }); } - console.log(messages) + console.log(messages); const res = await openai.createChatCompletion({ model: "gpt-3.5-turbo", messages: messages, }); - return res.data.choices[0].message.content + return res.data.choices[0].message.content; };