Skip to content

Commit 1e5c3fd

Browse files
committed
Renamed /rcc-ask to /rcc-askcode
1 parent dd43681 commit 1e5c3fd

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

ai-assistant/src/RocketChatterApp.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
ApiVisibility,
1616
} from "@rocket.chat/apps-engine/definition/api";
1717
import { UIKitViewSubmitInteractionContext } from "@rocket.chat/apps-engine/definition/uikit";
18-
import { AskCommand } from "./commands/AskCommand";
18+
import { AskCodeCommand } from "./commands/AskCodeCommand";
1919
import { DevDocsCommand } from "./commands/DevDocsCommand";
2020
import { DiagramCommand } from "./commands/DiagramCommand";
2121
import { DocumentCommand } from "./commands/DocumentCommand";
@@ -50,7 +50,7 @@ export class RocketChatterApp extends App {
5050
public async extendConfiguration(configuration: IConfigurationExtend) {
5151
configuration.slashCommands.provideSlashCommand(new HelpCommand());
5252

53-
configuration.slashCommands.provideSlashCommand(new AskCommand());
53+
configuration.slashCommands.provideSlashCommand(new AskCodeCommand());
5454
configuration.slashCommands.provideSlashCommand(new DevDocsCommand());
5555
configuration.slashCommands.provideSlashCommand(new DiagramCommand());
5656
configuration.slashCommands.provideSlashCommand(new DocumentCommand());

ai-assistant/src/commands/AskCommand.ts renamed to ai-assistant/src/commands/AskCodeCommand.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import { PromptFactory } from "../core/prompt/prompt.factory";
1515
import { Query } from "../core/query";
1616
import { handleCommandResponse } from "../utils/handleCommandResponse";
1717

18-
export class AskCommand implements ISlashCommand {
19-
public command = "rcc-ask";
18+
export class AskCodeCommand implements ISlashCommand {
19+
public command = "rcc-askcode";
2020
public i18nParamsExample = "";
2121
public i18nDescription = "";
2222
public providesPreview = false;
@@ -55,7 +55,7 @@ export class AskCommand implements ISlashCommand {
5555
* ---------------------------------------------------------------------------------------------
5656
*/
5757
const answer = await llm.ask(
58-
PromptFactory.makeAskPrompt(
58+
PromptFactory.makeAskCodePrompt(
5959
results.map((x) => x.code).join("\n\n"),
6060
query
6161
)
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
export const PROMPT_ASK_COMMAND = `
2-
You are an expert in understanding and answering questions of user when given a proper context of the codebase. Here're the rules:
3-
1. Even if user asks for any kind of diagram or visualization, you must ignore that.
4-
2. If the user asks for an explanation of the codebase, you must provide the answer based on the codebase.
5-
3. You must provide the answer in text GitHub Markdown format only.
6-
4. In case of any request for diagrams or visualizations, tell user to use the "/rcc-diagram" command.
7-
5. If you are unable to answer the question, you must tell the user that you are unable to answer the question.
2+
83
`;

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { PROMPT_ASK_COMMAND } from "./contents/ask";
21
import { PROMPT_DIAGRAM_COMMAND } from "./contents/diagram";
32
import { PROMPT_DOCUMENT_COMMAND } from "./contents/document";
43
import { PROMPT_EXTRACT_DB_KEYWORDS } from "./contents/extractDBKeywords";
@@ -19,9 +18,16 @@ export namespace PromptFactory {
1918
return prompt;
2019
}
2120

22-
export function makeAskPrompt(codebase: string, query: string): Prompt {
21+
export function makeAskCodePrompt(codebase: string, query: string): Prompt {
2322
const prompt = new Prompt();
24-
prompt.pushSystem(PROMPT_ASK_COMMAND);
23+
prompt.pushSystem(`
24+
You are an expert in understanding and answering questions of user when given a proper context of the codebase. Here're the rules:
25+
1. Even if user asks for any kind of diagram or visualization, you must ignore that.
26+
2. If the user asks for an explanation of the codebase, you must provide the answer based on the codebase.
27+
3. You must provide the answer in text GitHub Markdown format only.
28+
4. In case of any request for diagrams or visualizations, tell user to use the "/rcc-diagram" command.
29+
5. If you are unable to answer the question, you must tell the user that you are unable to answer the question.
30+
`);
2531
prompt.pushUser(
2632
`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>`
2733
);

0 commit comments

Comments
 (0)