mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 02:18:08 +08:00
fix(web): keep hit-testing payload
This commit is contained in:
@ -28,6 +28,7 @@ import type {
|
|||||||
FetchDatasetsParams,
|
FetchDatasetsParams,
|
||||||
FileIndexingEstimateResponse,
|
FileIndexingEstimateResponse,
|
||||||
HitTestingRecordsResponse,
|
HitTestingRecordsResponse,
|
||||||
|
HitTestingRequest,
|
||||||
HitTestingResponse,
|
HitTestingResponse,
|
||||||
IndexingEstimateParams,
|
IndexingEstimateParams,
|
||||||
IndexingEstimateResponse,
|
IndexingEstimateResponse,
|
||||||
@ -187,8 +188,8 @@ export const modifyDocMetadata = ({ datasetId, documentId, body }: CommonDocReq
|
|||||||
}
|
}
|
||||||
|
|
||||||
// hit testing
|
// hit testing
|
||||||
export const hitTesting = ({ datasetId, queryText, retrieval_model }: { datasetId: string, queryText: string, retrieval_model: RetrievalConfig }): Promise<HitTestingResponse> => {
|
export const hitTesting = ({ datasetId, query, retrieval_model, attachment_ids }: { datasetId: string } & HitTestingRequest): Promise<HitTestingResponse> => {
|
||||||
return post<HitTestingResponse>(`/datasets/${datasetId}/hit-testing`, { body: { query: queryText, retrieval_model } })
|
return post<HitTestingResponse>(`/datasets/${datasetId}/hit-testing`, { body: { query, retrieval_model, attachment_ids } })
|
||||||
}
|
}
|
||||||
|
|
||||||
export const externalKnowledgeBaseHitTesting = ({ datasetId, query, external_retrieval_model }: { datasetId: string, query: string, external_retrieval_model: { top_k: number, score_threshold: number, score_threshold_enabled: boolean } }): Promise<ExternalKnowledgeBaseHitTestingResponse> => {
|
export const externalKnowledgeBaseHitTesting = ({ datasetId, query, external_retrieval_model }: { datasetId: string, query: string, external_retrieval_model: { top_k: number, score_threshold: number, score_threshold_enabled: boolean } }): Promise<ExternalKnowledgeBaseHitTestingResponse> => {
|
||||||
|
|||||||
@ -26,7 +26,7 @@ export const useInvalidateHitTestingRecords = (datasetId: string) => {
|
|||||||
export const useHitTesting = (datasetId: string) => {
|
export const useHitTesting = (datasetId: string) => {
|
||||||
return useMutation({
|
return useMutation({
|
||||||
mutationKey: [NAME_SPACE, 'hit-testing', datasetId],
|
mutationKey: [NAME_SPACE, 'hit-testing', datasetId],
|
||||||
mutationFn: (params: HitTestingRequest) => hitTesting({ datasetId, queryText: params.query, retrieval_model: params.retrieval_model }),
|
mutationFn: (params: HitTestingRequest) => hitTesting({ datasetId, ...params }),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user