🗃️ fix: revise RAG prompt (#3006)

This commit is contained in:
Danny Avila 2024-06-07 20:51:43 -04:00 committed by GitHub
parent baf0848021
commit 084cf266a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 are unsure how to answer, ask for clarification.
- Avoid mentioning that you obtained the information from the context.
Answer appropriately in the user's language.
`;
function createContextHandlers(req, userMessageContent) {
@ -94,7 +92,10 @@ function createContextHandlers(req, userMessageContent) {
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) => {
const file = processedFiles[index];
let contextItems = queryResult.data;