forked from open-webui/open-webui
feat: frontend file upload support
This commit is contained in:
parent
3229ec116c
commit
fef4725d56
6 changed files with 223 additions and 92 deletions
20
src/lib/utils/rag/index.ts
Normal file
20
src/lib/utils/rag/index.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
export const RAGTemplate = (context: string, query: string) => {
|
||||
let template = `Use the following context as your learned knowledge, inside <context></context> XML tags.
|
||||
<context>
|
||||
[context]
|
||||
</context>
|
||||
|
||||
When answer to user:
|
||||
- If you don't know, just say that you don't know.
|
||||
- If you don't know when you are not sure, ask for clarification.
|
||||
Avoid mentioning that you obtained the information from the context.
|
||||
And answer according to the language of the user's question.
|
||||
|
||||
Given the context information, answer the query.
|
||||
Query: [query]`;
|
||||
|
||||
template = template.replace(/\[context\]/g, context);
|
||||
template = template.replace(/\[query\]/g, query);
|
||||
|
||||
return template;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue