Skip to content

Commit 18f4daa

Browse files
committed
Completed /rcc-document command
1 parent 75f8540 commit 18f4daa

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

ai-assistant/src/commands/DocumentCommand.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export class DocumentCommand implements ISlashCommand {
2323
private async process(
2424
http: IHttp,
2525
query: string
26-
): Promise<Record<string, string> | null> {
26+
): Promise<{ jsDoc: string; explanation: string | null } | null> {
2727
const db = new Neo4j(http);
2828
const llm = new Llama3_70B(http);
2929
const embeddingModel = new MiniLML6(http);
@@ -35,7 +35,6 @@ export class DocumentCommand implements ISlashCommand {
3535
* ---------------------------------------------------------------------------------------------
3636
*/
3737
const keywords = await Query.getDBKeywordsFromQuery(llm, query);
38-
console.log("KEYWORDS", keywords);
3938
if (!keywords.length) return null;
4039

4140
/**
@@ -73,10 +72,10 @@ export class DocumentCommand implements ISlashCommand {
7372
.split("<EXPLANATION_END>")[0]
7473
.trim();
7574

76-
console.log(jsDoc);
77-
console.log(explanation);
78-
79-
return { jsDoc: jsDoc, explanation: explanation };
75+
return {
76+
jsDoc: "```typescript\n" + jsDoc + "\n```",
77+
explanation: explanation,
78+
};
8079
}
8180

8281
public async executor(
@@ -98,7 +97,7 @@ export class DocumentCommand implements ISlashCommand {
9897

9998
let res = await this.process(http, query);
10099
if (res) {
101-
await sendEditedMessage(`${res["jsDoc"]}\n\n${res["explanation"]}`);
100+
await sendEditedMessage(`${res.jsDoc}\n\n${res.explanation}`);
102101
} else {
103102
await sendEditedMessage("❌ No references found!");
104103
}

0 commit comments

Comments
 (0)