Skip to content

Commit 8a181ef

Browse files
committed
Fixed prompt of /rcc-whyused
1 parent 2fe8287 commit 8a181ef

File tree

2 files changed

+3
-18
lines changed

2 files changed

+3
-18
lines changed

ai-assistant/src/core/prompt/contents/whyUsed.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,13 @@ EXPECTED OUTPUT:
1010
- NEVER NEVER NEVER explain the entity itself or it's working.
1111
- ALWAYS explain where and why it's used in the codebase with due reasoning and mention of the file and line number.
1212
</EXPLANATION>
13-
<IMPACT>
14-
- Provide the impact score of the target entity based on the number of usages and the importance of the file.
15-
</IMPACT>
1613
<DIAGRAM>
1714
- You only provide flowchart or sequence diagram in the mermaid 8.9.0 format.
1815
- 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.
1916
- The output must not have any kind of errors and must render properly.
2017
</DIAGRAM>
2118
</ANSWER>
22-
19+
2320
RULES:
2421
- NEVER NEVER NEVER explain the entity itself or it's working.
2522
- Don't tell me how to use that entity in the codebase.

ai-assistant/src/core/prompt/prompt.factory.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -77,22 +77,10 @@ export namespace PromptFactory {
7777

7878
export function makeWhyUsedPrompt(codebase: string, query: string): Prompt {
7979
const prompt = new Prompt();
80-
8180
prompt.pushSystem(PROMPT_WHY_USED_COMMAND);
82-
prompt.pushAssistant(
83-
"Sure, I will strictly follow my instructions. I will only provide the answer in the above specified format only."
84-
);
85-
prompt.pushSystem(`
86-
HERE'RE THE NODES OF THE CODEBASE TO USE AS CONTEXT:
87-
<CODEBASE_START>
88-
${codebase}
89-
</CODEBASE_END>
90-
`);
91-
prompt.pushAssistant(
92-
"Yeah sure. If I don't know the answer, I'll tell it to you."
81+
prompt.pushUser(
82+
`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>`
9383
);
94-
prompt.pushUser(query);
95-
prompt.pushSystem("<ANSWER>");
9684

9785
return prompt;
9886
}

0 commit comments

Comments
 (0)