mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-11 16:28:58 +08:00
feat: economical index support retrieval testing (#3563)
This commit is contained in:
parent
be3b37114c
commit
40b48510f4
@ -49,7 +49,14 @@ const TextAreaWithButton = ({
|
|||||||
const onSubmit = async () => {
|
const onSubmit = async () => {
|
||||||
setLoading(true)
|
setLoading(true)
|
||||||
const [e, res] = await asyncRunSafe<HitTestingResponse>(
|
const [e, res] = await asyncRunSafe<HitTestingResponse>(
|
||||||
hitTesting({ datasetId, queryText: text, retrieval_model: retrievalConfig }) as Promise<HitTestingResponse>,
|
hitTesting({
|
||||||
|
datasetId,
|
||||||
|
queryText: text,
|
||||||
|
retrieval_model: {
|
||||||
|
...retrievalConfig,
|
||||||
|
search_method: isEconomy ? RETRIEVE_METHOD.keywordSearch : retrievalConfig.search_method,
|
||||||
|
},
|
||||||
|
}) as Promise<HitTestingResponse>,
|
||||||
)
|
)
|
||||||
if (!e) {
|
if (!e) {
|
||||||
setHitResult(res)
|
setHitResult(res)
|
||||||
@ -102,7 +109,7 @@ const TextAreaWithButton = ({
|
|||||||
<Tag color="red" className="!text-red-600">
|
<Tag color="red" className="!text-red-600">
|
||||||
{text?.length}
|
{text?.length}
|
||||||
<span className="text-red-300 mx-0.5">/</span>
|
<span className="text-red-300 mx-0.5">/</span>
|
||||||
200
|
200
|
||||||
</Tag>
|
</Tag>
|
||||||
</div>
|
</div>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
@ -114,25 +121,20 @@ const TextAreaWithButton = ({
|
|||||||
>
|
>
|
||||||
{text?.length}
|
{text?.length}
|
||||||
<span className="text-gray-300 mx-0.5">/</span>
|
<span className="text-gray-300 mx-0.5">/</span>
|
||||||
200
|
200
|
||||||
</Tag>
|
</Tag>
|
||||||
)}
|
)}
|
||||||
<Tooltip
|
|
||||||
selector="hit-testing-submit"
|
<div>
|
||||||
disabled={indexingTechnique === 'high_quality'}
|
<Button
|
||||||
content={t('datasetHitTesting.input.indexWarning') as string}
|
onClick={onSubmit}
|
||||||
>
|
type="primary"
|
||||||
<div>
|
loading={loading}
|
||||||
<Button
|
disabled={(!text?.length || text?.length > 200)}
|
||||||
onClick={onSubmit}
|
>
|
||||||
type="primary"
|
{t('datasetHitTesting.input.testing')}
|
||||||
loading={loading}
|
</Button>
|
||||||
disabled={indexingTechnique !== 'high_quality' ? true : (!text?.length || text?.length > 200)}
|
</div>
|
||||||
>
|
|
||||||
{t('datasetHitTesting.input.testing')}
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</Tooltip>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -33,6 +33,7 @@ export enum RETRIEVE_METHOD {
|
|||||||
fullText = 'full_text_search',
|
fullText = 'full_text_search',
|
||||||
hybrid = 'hybrid_search',
|
hybrid = 'hybrid_search',
|
||||||
invertedIndex = 'invertedIndex',
|
invertedIndex = 'invertedIndex',
|
||||||
|
keywordSearch = 'keyword_search',
|
||||||
}
|
}
|
||||||
|
|
||||||
export type VariableInput = {
|
export type VariableInput = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user