[FIX] OpenAI compatible endpoints query mode developer API bug fix ()

fix query mode always responding with refusal message on develop api openai compatible endpoints
This commit is contained in:
Sean Hatfield 2024-06-28 14:23:16 -07:00 committed by GitHub
parent 7a78ad3960
commit 910eb36cfe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -112,8 +112,8 @@ async function chatSync({
}
// For OpenAI Compatible chats, we cannot do backfilling so we simply aggregate results here.
contextTexts = [...contextTexts];
sources = [...sources];
contextTexts = [...contextTexts, ...vectorSearchResults.contextTexts];
sources = [...sources, ...vectorSearchResults.sources];
// If in query mode and no context chunks are found from search, backfill, or pins - do not
// let the LLM try to hallucinate a response or use general knowledge and exit early
@ -328,8 +328,8 @@ async function streamChat({
}
// For OpenAI Compatible chats, we cannot do backfilling so we simply aggregate results here.
contextTexts = [...contextTexts];
sources = [...sources];
contextTexts = [...contextTexts, ...vectorSearchResults.contextTexts];
sources = [...sources, ...vectorSearchResults.sources];
// If in query mode and no context chunks are found from search, backfill, or pins - do not
// let the LLM try to hallucinate a response or use general knowledge and exit early