Skip to content

Commit

Permalink
fix csv
Browse files Browse the repository at this point in the history
  • Loading branch information
f committed Jan 6, 2025
1 parent 44f48d3 commit 2562eb1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/workflows/ai_bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,19 @@ jobs:
title = title.trim();
// Remove "Act as" or "Act as a" or "Act as an" from start if present
title = title.replace(/^Act as (?:a |an )?/i, '');
// Capitalize each word except common articles and prepositions
const lowercaseWords = ['a', 'an', 'the', 'and', 'but', 'or', 'for', 'nor', 'on', 'at', 'to', 'for', 'with', 'in'];
const capitalized = title.toLowerCase().split(' ').map((word, index) => {
// Always capitalize first and last word
if (index === 0 || !lowercaseWords.includes(word)) {
return word.charAt(0).toUpperCase() + word.slice(1);
}
return word;
}).join(' ');
// Add "Act as" prefix
return `Act as ${title}`;
return `Act as ${capitalized}`;
};
// First try to find prompts in README
Expand Down

0 comments on commit 2562eb1

Please sign in to comment.