mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 17:30:16 +01:00
🗃️ fix: revise RAG prompt (#3006)
This commit is contained in:
parent
baf0848021
commit
084cf266a2
1 changed files with 20 additions and 19 deletions
|
|
@ -8,8 +8,6 @@ In your response, remember to follow these guidelines:
|
||||||
- If you don't know the answer, simply say that you don't know.
|
- If you don't know the answer, simply say that you don't know.
|
||||||
- If you are unsure how to answer, ask for clarification.
|
- If you are unsure how to answer, ask for clarification.
|
||||||
- Avoid mentioning that you obtained the information from the context.
|
- Avoid mentioning that you obtained the information from the context.
|
||||||
|
|
||||||
Answer appropriately in the user's language.
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
function createContextHandlers(req, userMessageContent) {
|
function createContextHandlers(req, userMessageContent) {
|
||||||
|
|
@ -94,7 +92,10 @@ function createContextHandlers(req, userMessageContent) {
|
||||||
|
|
||||||
const resolvedQueries = await Promise.all(queryPromises);
|
const resolvedQueries = await Promise.all(queryPromises);
|
||||||
|
|
||||||
const context = resolvedQueries
|
const context =
|
||||||
|
resolvedQueries.length === 0
|
||||||
|
? '\n\tThe semantic search did not return any results.'
|
||||||
|
: resolvedQueries
|
||||||
.map((queryResult, index) => {
|
.map((queryResult, index) => {
|
||||||
const file = processedFiles[index];
|
const file = processedFiles[index];
|
||||||
let contextItems = queryResult.data;
|
let contextItems = queryResult.data;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue