Enable the use of AiPersonalities
This commit is contained in:
parent
ea43984ec6
commit
7a9d296530
|
@ -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 });
|
||||
|
||||
|
|
Loading…
Reference in a new issue