-
Notifications
You must be signed in to change notification settings - Fork 0
feat: emoji suggestion via Gemini AI and theme cycle toggle #26
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
base: develop
Are you sure you want to change the base?
Changes from 7 commits
1a87440
e088d41
433228e
a487eff
0e3ca6b
51ea4bb
f57f6f9
fab046d
3775caa
eaa362c
5c35df0
4aaa2cc
3d1db6c
deaf187
d976140
810ea22
e650167
59b2378
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import { GoogleGenerativeAI } from "@google/generative-ai"; | ||
| import { NextRequest, NextResponse } from "next/server"; | ||
|
|
||
| const genAI = new GoogleGenerativeAI( | ||
| process.env.GOOGLE_GENERATIVE_AI_API_KEY! | ||
| ); | ||
|
|
||
| export async function POST(req: NextRequest) { | ||
| const { name } = await req.json(); | ||
| if (!name?.trim()) return NextResponse.json({ emojis: [] }); | ||
|
|
||
| const model = genAI.getGenerativeModel({ model: "gemini-2.5-flash-lite" }); | ||
| const result = await model.generateContent( | ||
|
guid3d marked this conversation as resolved.
Outdated
|
||
| `Given the transaction name: "${name}", suggest 5 relevant emojis. Reply with ONLY the 5 emojis separated by spaces, nothing else. No words, no punctuation, just emojis.` | ||
| ); | ||
| const text = result.response.text().trim(); | ||
| const emojis = [...new Intl.Segmenter().segment(text)] | ||
| .map((s) => s.segment) | ||
| .filter((s) => /\p{Emoji}/u.test(s) && s !== " ") | ||
| .slice(0, 5); | ||
|
|
||
| return NextResponse.json({ emojis }); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,7 +22,7 @@ const PageSetDetails = ({ form }: PageSetDetailsProps) => { | |
| </Text> | ||
| </Center> | ||
| <Center> | ||
| <EmojiActionButtion form={form} /> | ||
| <EmojiActionButtion form={form} suggestionQuery={form.values.name} /> | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @copilot apply changes based on this feedback
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Implemented in commit The transaction details page now only passes Screenshot: behavior-only fix (no visual UI change in this update). |
||
| </Center> | ||
| <BigTextInput | ||
| placeholder="Name" | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.