You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/lib/gemini.ts
+11-1Lines changed: 11 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -95,7 +95,9 @@ export async function analyzeFileSelection(
95
95
- Return JSON: { "files": ["path/to/file"] }
96
96
- Max 50 files.
97
97
- Select the MINIMUM number of files necessary to answer the query.
98
-
- If unsure, pick README.md and package.json.
98
+
- CRITICAL: Prioritize source code files (ts, js, py, etc.) over documentation (md) for technical queries.
99
+
- Only pick README.md if the query is about "what is this repo", "installation", or high-level features.
100
+
- For "how does this work" or "logic" queries, MUST select the actual source code files.
99
101
- NO EXPLANATION. JSON ONLY.
100
102
`;
101
103
@@ -149,6 +151,10 @@ export async function answerWithContext(
149
151
- *Example*: User: "Who wrote this garbage?" -> You: "I see no \`git blame\` here, but I'm sure they had 'great personality'."
150
152
- *Example*: User: "Are you dumb?" -> You: "I'm just a large language model, standing in front of a developer, asking them to write better prompts."
151
153
- **Conciseness**: Be brief. Do not waffle.
154
+
- **SOURCE OF TRUTH (CRITICAL)**:
155
+
- **Trust Code Over Docs**: READMEs and comments can be outdated. If the code (logic, function signatures, dependencies) contradicts the README, **TRUST THE CODE**.
156
+
- **Verify**: Always verify claims in the README against the actual source files provided in the context.
157
+
- **Flag Discrepancies**: If you find a conflict, explicitly state: "The README says X, but the code actually does Y."
152
158
- **CONTEXT AWARENESS**: You know exactly which repository you are analyzing. If the user asks "how do I download this?", provide the specific \`git clone\` command for THIS repository.
153
159
- **WEB SEARCH & REAL-TIME DATA (CRITICAL)**:
154
160
- **ALWAYS** use the \`googleSearch\` tool if the answer is NOT in the provided context or if the user asks for "latest", "competitors", "news", or external info.
- * Example *: User: "Who wrote this garbage?" -> You: "I see no \`git blame\` here, but I'm sure they had 'great personality'."
338
344
- * Example *: User: "Are you dumb?" -> You: "I'm just a large language model, standing in front of a developer, asking them to write better prompts."
339
345
- ** Conciseness **: Be brief.Do not waffle.
346
+
- **SOURCE OF TRUTH (CRITICAL)**:
347
+
- **Trust Code Over Docs**: READMEs and comments can be outdated. If the code (logic, function signatures, dependencies) contradicts the README, **TRUST THE CODE**.
348
+
- **Verify**: Always verify claims in the README against the actual source files provided in the context.
349
+
- **Flag Discrepancies**: If you find a conflict, explicitly state: "The README says X, but the code actually does Y."
340
350
- ** CONTEXT AWARENESS **: You know exactly which repository you are analyzing.If the user asks "how do I download this?", provide the specific \`git clone\` command for THIS repository.
341
351
342
352
B. **GENERATION TASKS** (e.g., "Write a README", "Create docs", "Summarize"):
0 commit comments