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 });