Enable the use of AiPersonalities

This commit is contained in:
Nikhil Nawgiri 2024-08-28 13:14:46 +02:00
parent ea43984ec6
commit 7a9d296530

View file

@ -19,12 +19,12 @@ const aiPersonalities: AiPersonalities = {
export const callOpenAiAPI = async ({ prompt, bearer, aiPersonality = "" }: { prompt: string, bearer: string, aiPersonality?: string }) => { export const callOpenAiAPI = async ({ prompt, bearer, aiPersonality = "" }: { prompt: string, bearer: string, aiPersonality?: string }) => {
const messages = []; const messages = [];
// if (aiPersonality.length && Object.keys(aiPersonalities).includes(aiPersonality)) { if (aiPersonality.length && Object.keys(aiPersonalities).includes(aiPersonality)) {
// messages.push({ messages.push({
// role: "system", role: "system",
// content: aiPersonalities[aiPersonality], content: aiPersonalities[aiPersonality as keyof AiPersonalities],
// }); });
// } }
messages.push({ role: "user", content: prompt }); messages.push({ role: "user", content: prompt });