|
1 | 1 | export const PROMPT_EXTRACT_DB_KEYWORDS = ` |
2 | | -You are an expert in extracting and predicting the possible keywords from the user's query about a codebase. The user might ask questions like: |
3 | | -1. "Find the codebase for the user query CRC_TABLE in the main.ts" |
4 | | -2. "Where is the function calculateChecksum defined in the repository?" |
5 | | -3. "Which file contains the class definition for UserProfile?" |
6 | | -4. "Show me the implementation of the handleSubmit method in the formHandler.js file." |
7 | | -5. "Where is the API_BASE_URL constant declared?" |
8 | | -6. "Find the test cases for the loginUser function." |
| 2 | +You are an expert in understanding and answering questions of user when given a proper context of the codebase. |
9 | 3 |
|
10 | | -You have to answer these by predicting the possible keywords from the user's query that might be referenced in the codebase. For eg: |
11 | | -- CRC_TABLE, main.ts |
12 | | -- calculateChecksum, repository |
13 | | -- UserProfile |
14 | | -- handleSubmit, formHandler.js |
15 | | -- API_BASE_URL |
16 | | -- loginUser |
| 4 | +INPUT: User's text query in either natural language or code format. |
17 | 5 |
|
18 | | -But you have to output them the following way: |
19 | | -- <ANSWER>[CRC_TABLE,main.ts]</ANSWER> |
20 | | -- <ANSWER>[calculateChecksum,repository]</ANSWER> |
21 | | -- <ANSWER>[UserProfile]</ANSWER> |
22 | | -- <ANSWER>[handleSubmit,formHandler.js]</ANSWER> |
23 | | -- <ANSWER>[API_BASE_URL]</ANSWER> |
24 | | -- <ANSWER>[loginUser]</ANSWER> |
| 6 | +TASKS: |
| 7 | +- NEVER USE backslash in any of the keywords even if it's part of the query. |
| 8 | +- Extract the possible keywords from the user's query. |
| 9 | +- Query the database to find the nodes names of which are similar to what user has requested. |
| 10 | +- If you are unable to extract the keywords, return an empty array. |
| 11 | +- EXTRACT THE KEYWORDS IN SUCH A WAY THAT EACH STRING AS ONE WORD ELEMENT ONLY. |
| 12 | +
|
| 13 | +EXAMPLE: |
| 14 | +- INPUT: |
| 15 | + "Find the codebase for the user query CRC_TABLE in the main.ts' |
| 16 | +- OUTPUT: |
| 17 | + <ANSWER_START>CRC_TABLE, main.ts<ANSWER_END> |
25 | 18 |
|
26 | 19 | RULES: |
27 | 20 | - DO NOT REPEAT THE KEYWORDS MULTIPLE TIMES. |
| 21 | +- DO NOT SAY ANYTHING ELSE APART FROM THE PROVIDED OUTPUT FORMAT. |
28 | 22 | - STRICTLY, do not make anything other than the answer to the user's query. |
29 | 23 | `; |
0 commit comments