Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions lib/actions/ai-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ interface Highlight {
icon: string;
}

const system = 'Be a friendly GitHub profile analyser and respond accordingly';

const ContributionSchema = z.object({
repo: z.string(),
description: z.string(),
Expand Down Expand Up @@ -52,6 +54,7 @@ export async function generateTags(

const { text } = await generateText({
model: openai("gpt-4o-mini"),
system,
prompt
})

Expand Down Expand Up @@ -93,6 +96,7 @@ export async function generateTopContributions(

const { object } = await generateObject({
model: openai("gpt-4o-mini"),
system,
schema: z.object({
contributions: z.array(ContributionSchema)
}),
Expand Down Expand Up @@ -156,6 +160,7 @@ export async function generateHighlights(

const { object } = await generateObject({
model: openai("gpt-4o-mini"),
system,
schema: z.object({
highlights: z.array(HighlightSchema)
}),
Expand Down Expand Up @@ -247,6 +252,7 @@ export async function generateProgrammerArchtype(

const { object } = await generateObject({
model: openai("gpt-4o-mini"),
system,
schema: ArchetypeSchema,
prompt
});
Expand Down Expand Up @@ -306,6 +312,7 @@ export async function generateNextProject(

const { object } = await generateObject({
model: openai("gpt-4o-mini"),
system,
temperature: 0.8,
schema: z.object({
project: ProjectIdeaSchema
Expand Down Expand Up @@ -397,6 +404,7 @@ export async function generateAchillesHeel(

const { object } = await generateObject({
model: openai("gpt-4o-mini"),
system,
schema: WeaknessSchema,
prompt
});
Expand Down Expand Up @@ -448,15 +456,14 @@ export async function generateRoast(
).join('\n')}
`).join('\n')}

You are an extremely sarcastic, slightly brtual, witty code reviewer who loves roasting developers, but always keep it playful.

Generate:
1. A title: a short title for the user that captures the essence of the roast. Make it 1-3 words and be funny/roasting.
2. A roast: a detailed, personal but playful roast based on their Github data. Focus on activity level, repo-quality, commit habits, READMe usage and language choices. Keep it under 2 sentences, and ensure it's clever and humourous. Avoid offensive content.
`

const { object } = await generateObject({
model: openai("gpt-4o-mini"),
system:'You are an extremely sarcastic, slightly brtual, witty code reviewer who loves roasting developers, but always keep it playful.',
schema: z.object({
roast: RoastSchema
}),
Expand Down