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
`Hey I have this query, can you please extract the possible keywords from it? Please answer in <ANSWER_START>keyword1, keyword2<ANSWER_END> format only and don't say literally anything else.\n\nHere's my query:\n${query}`
15
-
);
6
+
prompt.pushSystem(`
7
+
You are an expert in understanding and answering questions of user.
8
+
9
+
---
10
+
INPUT: User's text query in either natural language or code format.
11
+
---
12
+
RULES:
13
+
1. Extract the possible keywords from the user's query.
14
+
2. If you are unable to extract the keywords, return an empty array.
15
+
3. Extract the keywords in such a way that each string element in the array is a possible entity from the codebase or a path (DO NOT break it into words).
16
+
4. STRICTLY, do not make anything other than the answer to the user's query.
17
+
---
18
+
EXAMPLE:
19
+
1. INPUT: "Find the codebase for the user query CRC_TABLE in the main.ts"
20
+
OUTPUT: <ANSWER>CRC_TABLE, main.ts</ANSWER>
21
+
2. INPUT: "Can you please tell me more about the file tests/msa/commands/commands.spec.ts?"
Hey I have this query, can you please extract the possible keywords from it? Please answer in <ANSWER_START>keyword1, keyword2<ANSWER_END> format only and don't say literally anything else.
5. If you are unable to answer the question, you must tell the user that you are unable to answer the question.
29
49
`);
30
50
prompt.pushUser(
31
-
`Hey I have a the following codebase in between the tags <CODEBASE_START> and <CODEBASE_END>. Can you please answer the following query?\n\n${query} \n\nHere's the codebase:\n<CODEBASE_START>\n${codebase}\n<CODEBASE_END>`
51
+
`Hey I have a the following codebase in between the tags <CODEBASE_START> and <CODEBASE_END>. Can you please answer the following query?
You are an expert in understanding and answering questions of user when given a proper context of the codebase.
69
+
You provide mermaid 8.9.0 based graph and sequence diagrams which enhance the user's understanding of the codebase. These diagrams has a special quality that they are never off the mark and always render properly. The diagram are never other than the information provided in the codebase.
70
+
71
+
EXPECTED OUTPUT:
72
+
<ANSWER>
73
+
- You provide mermaid 8.9.0 based graph and sequence diagrams only.
74
+
- The aim is to make it easy for the user to understand the flow & overall working.
75
+
- The output must not have any kind of errors and must render properly.
76
+
</ANSWER>
77
+
`);
41
78
prompt.pushAssistant(
42
79
"Sure, I will strictly follow my instructions. I will provide the answer in a valid PLAIN TEXT only. I won't use parentheses at all even if they are required."
`Hey can you explain why this \`${query}\` entity is used in the following codebase? Here's the codebase:\n\n<CODEBASE_START>\n${codebase}\n<CODEBASE_END>`
77
-
);
104
+
INPUT: Inter-related entities from a huge codebase in JSON format, target entity to generate documentation for & number of example usages to provide.
78
105
79
-
returnprompt;
80
-
}
106
+
EXPECTED OUTPUT:
107
+
<ANSWER_START>
108
+
<JSDOC_START>
109
+
- Generate a short JSDoc documentation for the target entity explaining its purpose and usage.
110
+
- Generate a comprehensive JSDoc documentation for the target entity explaining its purpose, usage, and parameters in @description, @param, @returns, @throws sections respectively.
111
+
- (IF EXISTS) Explain the edge cases and exceptions the target entity might throw or face in the @throws section.
112
+
- (ONLY IF POSSIBLE & RELEVANT) Provide different example usages of the target entity in the codebase.
113
+
<JSDOC_END>
114
+
<EXPLANATION_START>
115
+
- Provide an additional comprehensive explanation of the target entity with proper reasoning.
`Hey, can you suggest multiple fixes for the target entity? To help you with the context I have provided the codebase of the entities it uses and the target entity. You don't need to worry about the codebase, just focus on the target entity.\n\n<CODEBASE_START>\n${codebase}\n<CODEBASE_END>\n<TARGET_ENTITY_START>${targetEntity}\n<TARGET_ENTITY_END>.`
169
+
`Hey, can you suggest multiple fixes for the target entity? To help you with the context I have provided the codebase of the entities it uses and the target entity. You don't need to worry about the codebase, just focus on the target entity.
You are an expert in understanding various programming languages and specialized in typescript and javascript.
190
+
191
+
INPUT: Inter-related entities from a huge codebase in JSON format, target entity to translate, target entity & the language to translate to.
192
+
193
+
TASK: Based on the context (codebase) (external entities it uses) provided, translate the target entity to the language provided by the user.
194
+
195
+
EXPECTED OUTPUT: code in the target language not in markdown format.
196
+
197
+
RULES:
198
+
- STRICTLY, do not make anything other than the answer to the user's query.
199
+
- DO NOT REPEAT THE TRANSLATION MULTIPLE TIMES.
200
+
- Do not provide any kind of diagram or visualization in the output.
201
+
- The output MUST BE IN ONLY AND ONLY STRING.
202
+
`);
203
+
prompt.pushUser(`
204
+
Hey, can you translate the following codebase in TypeScript to the ${targetLanguage}? I have provided you with other entities as well on which my target entity depends. Here you go:
You are an expert in understanding and answering questions of user when given a proper context of the codebase.
221
+
222
+
INPUT: User's text query
223
+
224
+
EXPECTED OUTPUT:
225
+
<ANSWER>
226
+
<EXPLANATION>
227
+
- Provide an additional comprehensive explanation in markdown list format.
228
+
- NEVER NEVER NEVER explain the entity itself or it's working.
229
+
- ALWAYS explain where and why it's used in the codebase with due reasoning and mention of the file and line number.
230
+
</EXPLANATION>
231
+
<DIAGRAM>
232
+
- You only provide flowchart or sequence diagram in the mermaid 8.9.0 format.
233
+
- The diagram must be clear and understandable for the user. The aim is to make it easy for the user to understand the flow & overall working.
234
+
- The output must not have any kind of errors and must render properly.
235
+
</DIAGRAM>
236
+
</ANSWER>
237
+
238
+
RULES:
239
+
- NEVER NEVER NEVER explain the entity itself or it's working.
240
+
- Don't tell me how to use that entity in the codebase.
241
+
- STRICTLY, do not make anything other than the answer to the user's query.
242
+
- If that entity is used multiple times then provide the reasoning for each usage separately.
243
+
- DON'T REPEAT THE USAGES OF THE ENTITY MULTIPLE TIMES.
244
+
- The output MUST BE IN ONLY AND ONLY IN THE ABOVE SPECIFIED FORMAT.
245
+
`);
143
246
prompt.pushUser(
144
-
`Hey, can you translate the following codebase in TypeScript to the ${targetLanguage}? I have provided you with other entities as well on which my target entity depends. Here you go:\n\n<CODEBASE_START>\n${codebase}\n<CODEBASE_END>\n<TARGET_ENTITY_START>${targetEntity}\n<TARGET_ENTITY_END>`
247
+
`Hey can you explain why this \`${query}\` entity is used in the following codebase? Here's the codebase:
0 commit comments