forked from nyago-d/LangChainSample
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrag_execute.ts
More file actions
26 lines (19 loc) · 790 Bytes
/
rag_execute.ts
File metadata and controls
26 lines (19 loc) · 790 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { getChatTemplate, getLLM, getRetriever, rag1, rag2, rag3, rag4, save } from "./rag";
import { stdin, stdout } from "process";
import { createInterface } from "readline/promises";
(async() => {
const retriever = getRetriever();
const llm = getLLM();
const chatTemplate = getChatTemplate();
// await save(vectorStore);
const reader = createInterface({
input: stdin,
output: stdout
});
const question = await reader.question("記念日について質問をどうぞ:");
reader.close();
await rag1(question, retriever, llm, chatTemplate);
await rag2(question, retriever, llm);
await rag3(question, retriever, llm, chatTemplate);
await rag4(question, retriever, llm, chatTemplate);
})();