Skip to content

update backend api#146

Merged
Deodat-Lawson merged 4 commits intostablefrom
main
Jan 16, 2026
Merged

update backend api#146
Deodat-Lawson merged 4 commits intostablefrom
main

Conversation

@Deodat-Lawson
Copy link
Copy Markdown
Owner

update backend api structure

@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
pdr-ai-v2 Ready Ready Preview, Comment Jan 16, 2026 4:22pm

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3bac1843da

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/lib/validation.ts
Comment on lines 68 to +69
const aiPersonaOptions = ["general", "learning-coach", "financial-expert", "legal-expert", "math-reasoning"] as const;
const aiModelOptions = ["gpt4", "claude", "gemini"] as const;
const aiModelOptions = ["gpt-4o", "claude-sonnet-4", "claude-opus-4.5", "gpt-5.2", "gpt-5.1", "gemini-2.5-flash", "gemini-3-flash", "gemini-3-pro"] as const;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve legacy aiModel names for backward compatibility

The QuestionSchema now only accepts the new model names (e.g., gpt-4o, claude-sonnet-4, gemini-2.5-flash). Since /api/AIAssistant is explicitly described as a backward-compatibility endpoint, any existing clients still sending legacy values like gpt4, claude, or gemini will now fail validation and receive a 400. Consider accepting legacy names here (or mapping them server-side) so older integrations keep working.

Useful? React with 👍 / 👎.

Comment on lines +116 to 120
} else if (error) {
// Add error message to chat
const errorAiMessage: AIMessage = {
id: (Date.now() + 1).toString(),
role: "ai",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Show AIQuery errors when the request fails

In this flow, sendQuery returns null on failure and sets its error state asynchronously. The UI only appends an error message if error is already set in the same render pass, so a failed request often produces no visible feedback at all. Users will see their question added but get no response when the API call fails (network errors, 4xx/5xx). Consider handling the error from the sendQuery call directly or reacting to error in an effect.

Useful? React with 👍 / 👎.

@Deodat-Lawson Deodat-Lawson merged commit 6894c4f into stable Jan 16, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant