-
Notifications
You must be signed in to change notification settings - Fork 0
Add research router #12
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.
|
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.
Review by RecurseML
🔍 Review performed on 327c8d4..5cfe36c
| Severity | Location | Issue | Delete |
|---|---|---|---|
| junction-app/lib/gemini.ts:4 | Missing required API key parameter |
✅ Files analyzed, no issues (3)
• junction-app/app/api/health/index.ts
• junction-app/bun.lock
• junction-app/package.json
| import { GoogleGenAI } from "@google/genai"; | ||
|
|
||
| // The client gets the API key from the environment variable `GEMINI_API_KEY`. | ||
| export const ai = new GoogleGenAI({}); |
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.
The GoogleGenAI client is initialized with an empty configuration object, missing the required 'apiKey' parameter. According to the official Google GenAI SDK documentation (https://docs.cloud.google.com/vertex-ai/generative-ai/docs/sdks/overview), the correct initialization requires explicitly passing the API key:
const GEMINI_API_KEY = process.env.GEMINI_API_KEY;
const ai = new GoogleGenAI({vertexai: false, apiKey: GEMINI_API_KEY});The current implementation passes an empty object {} without the required apiKey parameter. While the comment suggests "The client gets the API key from the environment variable GEMINI_API_KEY", the @google/genai library does NOT automatically read environment variables without explicit configuration.
When this client is used to make any API calls (e.g., ai.models.generateContent()), it will fail with an authentication error because no API key is configured. This will cause immediate runtime failures in any code that imports and uses this client.
To fix this bug, the code should be updated to:
import { GoogleGenAI } from "@google/genai";
const GEMINI_API_KEY = process.env.GEMINI_API_KEY;
export const ai = new GoogleGenAI({apiKey: GEMINI_API_KEY});React with 👍 to tell me that this comment was useful, or 👎 if not (and I'll stop posting more comments like this in the future)
…on; add health check endpoint
…; update query handling to open modal on entity not found
Add research router
High-level PR Summary
This PR adds infrastructure for a research router by integrating the Google Gemini AI SDK (
@google/genai). It includes a health check endpoint at/api/health, initializes a Gemini AI client inlib/gemini.ts, and updates dependencies to include the necessary Google AI library along with its transitive dependencies.⏱️ Estimated Review Time: 15-30 minutes
💡 Review Order Suggestion
junction-app/app/api/health/index.tsjunction-app/lib/gemini.tsjunction-app/package.jsonjunction-app/bun.lockjunction-app/app/api/health/index.ts