-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Search] [Playground] Switch off condensing question flow for first q…
…uestion (#180222) Two changes where: - condensing question LLM flow is rewriting the question with quotes and breaking the parsing. This escapes quotes. - skipping the condensing question function when theres no chat history
- Loading branch information
1 parent
c73a83e
commit 7abe4c2
Showing
4 changed files
with
165 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { createRetriever } from './routes'; | ||
|
||
describe('createRetriever', () => { | ||
test('works when the question has quotes', () => { | ||
const esQuery = '{"query": {"match": {"text": "{query}"}}}'; | ||
const question = 'How can I "do something" with quotes?'; | ||
|
||
const retriever = createRetriever(esQuery); | ||
const result = retriever(question); | ||
|
||
expect(result).toEqual({ match: { text: 'How can I "do something" with quotes?' } }); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters