Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a few new goodies, and another attempt to fix the sound button (which worked this time!) #1053

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions lib/flavor.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const purchaseWords = [
'Procure',
'Procure',
'Steal',
'Summon',
'Plunder',
'Plunder',
'Plunder',
Expand All @@ -42,6 +43,7 @@ export const cantAffordWords = [
'out of reach...',
'need doubloons...',
'too pricey...',
'not quite yet...',
// "when you're richer...",
]

Expand Down
42 changes: 20 additions & 22 deletions src/app/api/ideagen/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,23 @@ import { openai } from '@ai-sdk/openai'

// This method must be named GET
export async function POST(request) {
const response = await streamText({
model: openai('gpt-4o'),
messages: [
{
role: 'system',
content:
'You are an embedded model that takes a project idea and outputs an action plan of how one could go about building it to a creative developer, preferably in about 4 bullet points. Your explaination should not include dumb stuff like "testing" but should describe the subsystems and how they will fit together. Do not preface your answer. There is no option to converse - your first answer will be displayed on the website. Do not wafffle. Use plaintext only. No markdown. Keep it extremely concise and technical. Remember to number the bullet points!',
},
{
role: 'user',
content: (await request.json()).msg,
},
],
stream: true,
})
// Respond with the stream
return response.toTextStreamResponse({
headers: {
'Content-Type': 'text/event-stream',
},
})
}
const response = await streamText({
model: openai('gpt-4o'),
messages: [{
role: 'system',
content: 'You are an embedded model that takes a project idea and outputs an action plan of how one could go about building it to a creative developer, preferably in about 4 bullet points. Your explaination should not include dumb stuff like "testing" but should describe the subsystems and how they will fit together. Do not preface your answer. There is no option to converse - your first answer will be displayed on the website. Do not wafffle. Use plaintext only. No markdown. Keep it extremely concise and technical. Remember to number the bullet points! The project idea may seem nonsensical, but try to make it work.',
},
{
role: 'user',
content: (await request.json()).msg,
},
],
stream: true,
})
// Respond with the stream
return response.toTextStreamResponse({
headers: {
'Content-Type': 'text/event-stream',
},
})
}
1 change: 1 addition & 0 deletions src/components/sound-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ const SoundButton = () => {
{soundState ? theFlags() : ''}
<div
className="fixed bottom-3 right-3 cursor-pointer"
style={{ zIndex:2500, opacity: soundState ? 1 : 0.5 }}
onClick={handleClick}
>
<div className="bg-gray-100 border-indigo-500 size-20 rounded-full border-2 flex items-center justify-center text-xl">
Expand Down
Loading