mirror of
https://github.com/System-End/site.git
synced 2026-04-19 20:55:09 +00:00
* init * res * git * more raccooooons * - * meta * arc! * eeby * deeby * title * rsvp * yarn * new tab * alt * nav * meta * color magic * img conditional * grants * rsvp link * hs * meta * change domain * Change CTA text on Arcade page * new! * powerups * powerup * ob? * temp fix * rev * gal * faq * launch! * link * Post to both arcadius & airtable! * /arcade * exisiting * width * banner * Add ID to shop section * Move old power hour arcade * Tweak project idea generator prompt * Setup API for new shop inventory * Pull carousel items from new table * Display new carousel items * responsive fix * s * Update thinking lines to be a dino * Generate highlighted items list * sp * page * page * Pull highlighted check from airtable * get outta here racoon * fix? * page * reduce space * enable temporary waitlist * fix error * Don't trigger arcadius * button * responsive * Fix the airtable RSVP * Add link to previous power hour in footer * Randomize shop order * Update announcement copy * Remove unused css * Remove amazon mention * Fix typo * Fix arcade api & accessibility tweaks (#1227) * fix grammar * add alt text * fix arcade api * Add missing wizard orpheus link * Update FAQ copy * Add mockup of shop with new order links * Reorder FAQ * Fix shop costs showing * Include current user balance on shop * Update cards & add modals (#1230) update cards & add modals Co-authored-by: Dillon Barnes <dillonb07dev@gnmail.com> * Fix some react mapping without keys * Hide items from client (#1231) * update cards & add modals * filter items sent to client * fix faq typo --------- Co-authored-by: Dillon Barnes <dillonb07dev@gnmail.com> * Whitelist fields pulled from arcade page * Redact fields on shop page data * style * shop css * add alt text * buy button * ticket * Comment outdated copy * Update index.js * quantity * Experiment with changing the "One hour at a time" section * quantities * q * Add links in Arcade FAQ (#1232) * add links in FAQ * update hack-hour to arcade * Bring back slack invites for arcade * fix css --------- Co-authored-by: belle <bellesee1212@gmail.com> Co-authored-by: Zach Latta <zach@zachlatta.com> Co-authored-by: Jasper Mayone <me@jaspermayone.com> Co-authored-by: Dillon Barnes <gh@dillonb07.studio> Co-authored-by: Dillon Barnes <dillonb07dev@gnmail.com> Co-authored-by: Sam Poder <39828164+sampoder@users.noreply.github.com>
35 lines
1.2 KiB
JavaScript
35 lines
1.2 KiB
JavaScript
import OpenAI from 'openai'
|
|
|
|
const sample = arr => arr[Math.floor(Math.random() * arr.length)]
|
|
|
|
const messageStarters = [
|
|
'you could build a',
|
|
'what if you built a',
|
|
'how about a',
|
|
'you could make a',
|
|
"as a dino, i'd build a",
|
|
"since it's summer, i'd make a",
|
|
"i've been dreaming of creating a",
|
|
'picture this:',
|
|
'oh, oh, oh! a',
|
|
'i dare you to make a',
|
|
]
|
|
|
|
const generateProjectIdea = async () => {
|
|
let prompt = `You are a software engineer that wants to bring joy through chaos. Something different every time. Please propose a funky simple project that will take under 6 hours to complete in 1 quick sentence. You can also suggest projects for a family member. Keep it at less than 15 words. The funkier, stupidier, and sillier your ideas the better. Your response must start with "${sample(messageStarters)}
|
|
`
|
|
// expects OPENAI_API_KEY
|
|
const openai = new OpenAI(process.env.OPENAI_API_KEY)
|
|
const chatCompletion = await openai.chat.completions.create({
|
|
messages: [{ role: 'user', content: prompt }],
|
|
model: 'gpt-3.5-turbo'
|
|
})
|
|
|
|
return chatCompletion.choices[0].message.content
|
|
}
|
|
|
|
export default async function handler(req, res) {
|
|
const recommendation = await generateProjectIdea()
|
|
|
|
res.send({ recommendation })
|
|
}
|