From 7a9d2965300c08aed64641fac50d3c9c67564c3e Mon Sep 17 00:00:00 2001 From: Nikhil Nawgiri Date: Wed, 28 Aug 2024 13:14:46 +0200 Subject: [PATCH] Enable the use of AiPersonalities --- src/openai.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/openai.ts b/src/openai.ts index 6a0b13a..1dab7e1 100644 --- a/src/openai.ts +++ b/src/openai.ts @@ -19,12 +19,12 @@ const aiPersonalities: AiPersonalities = { export const callOpenAiAPI = async ({ prompt, bearer, aiPersonality = "" }: { prompt: string, bearer: string, aiPersonality?: string }) => { const messages = []; - // if (aiPersonality.length && Object.keys(aiPersonalities).includes(aiPersonality)) { - // messages.push({ - // role: "system", - // content: aiPersonalities[aiPersonality], - // }); - // } + if (aiPersonality.length && Object.keys(aiPersonalities).includes(aiPersonality)) { + messages.push({ + role: "system", + content: aiPersonalities[aiPersonality as keyof AiPersonalities], + }); + } messages.push({ role: "user", content: prompt });