-
Notifications
You must be signed in to change notification settings - Fork 11
feat: AI chat landing page #126
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| export const SUGGESTED_QUESTIONS = [ | ||
| "Where can I buy RECALL tokens?", | ||
| "How do AI competitions work on Recall?", | ||
| "What are skill markets?", | ||
| "How do I enter my first competition?", | ||
| "How can I stake RECALL tokens?", | ||
| "What is boosting and how does it work?", | ||
| "What rewards can I earn on Recall?", | ||
| "How do agents prove their performance?", | ||
| "What makes Recall decentralized?", | ||
| "How does staking relate to boosting?", | ||
| ] as const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is where we can hard-code the questions we want the initial suggestions and follow-up suggestions to draw from.
1a31fba to
dfcd654
Compare
|
@andrewxhill wdyt? I'm reluctant to double the height of the box when we don't have model toggle, photo upload, or other buttons asking for it.
|
|
Lgtm |
update Ask AI styling and functionality to match
5c51528 to
1c9e2e5
Compare
The generateContextualSuggestions function now receives the complete conversation history including the assistant's streamed response, making suggestions truly contextual to what was just answered. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional Suggestion:
The client-side stream parser will crash with a JSON parsing error when it encounters the data: [DONE] marker that the OpenAI API sends to signal the end of the stream, causing the entire response to fail with "Sorry, something went wrong."
View Details
📝 Patch Details
diff --git a/components/ai/engines/openai.ts b/components/ai/engines/openai.ts
index 8e47d93..92f7b5d 100644
--- a/components/ai/engines/openai.ts
+++ b/components/ai/engines/openai.ts
@@ -89,7 +89,15 @@ export async function createOpenAIEngine(): Promise<Engine> {
for (const line of lines) {
if (aborted || !line.trim()) continue;
- const json = JSON.parse(line);
+ // Handle Server-Sent Events format
+ let jsonData = line;
+ if (line.startsWith("data: ")) {
+ const data = line.slice(6);
+ if (data === "[DONE]") continue;
+ jsonData = data;
+ }
+
+ const json = JSON.parse(jsonData);
if ("choices" in json && Array.isArray(json.choices)) {
const delta = (json as OpenAIResponse).choices[0]?.delta?.content || "";
if (delta) {
Analysis
Client-side SSE parser crashes on OpenAI's data: [DONE] marker
What fails: The JSON.parse(line) call in components/ai/engines/openai.ts:92 attempts to parse Server-Sent Events formatted lines directly as JSON, causing crashes on both valid SSE messages and the data: [DONE] termination marker.
How to reproduce:
]}"
# "data: [DONE]"
# Both cause JSON.parse to fail since they include the "data: " SSE prefixResult: JSON.parse("data: [DONE]") throws SyntaxError: Unexpected token 'd', caught by the try-catch block at line 114, replacing successful AI responses with "Sorry, something went wrong."
Expected: Client should handle SSE format correctly by parsing only the content after "data: " prefix, as the server-side transform already does at app/api/chat/route.ts:179-182




Update landing page to an AI chat
Suggest questions to help users discover what to ask
Offer follow-up questions relevant to conversation as it unfolds
Update existing "Ask AI" pop-up styling and functionality to match
Landing page:

Ask AI button pop-up:

2025-10-23.09-02-39.mp4