Skip to content

Commit

Permalink
update taboo words generation to be generic
Browse files Browse the repository at this point in the history
  • Loading branch information
xmliszt committed Apr 12, 2024
1 parent 19cab41 commit 83abf69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/level/[id]/server/generate-taboo-words-from-ai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import { formatResponseTextIntoArray } from '@/lib/utilities';
*/
export async function generateTabooWordsFromAI(targetWord: string, topic?: string) {
cookies(); // opt-out for caching
console.log(`Generating taboo words for ${targetWord} in ${topic}. Topic is omitted currently.`);
const target = toLower(trim(targetWord));
const prompt =
`Generate 5-8 words related to '${target}',` +
(topic ? ` in the topic of ${topic},` : ' ') +
` in American English. Avoid plural and duplicates. Insert the words in an comma separated array: [word1, word2, ...]`;

const completion = await googleGeminiPro.generateContent(prompt);
Expand Down

0 comments on commit 83abf69

Please sign in to comment.