mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-10 03:16:51 +08:00
feat: add retriever rank fe (#1557)
Co-authored-by: StyleZhang <jasonapring2015@outlook.com>
This commit is contained in:
@@ -27,6 +27,7 @@ import type {
|
||||
ValidateOpenAIKeyResponse,
|
||||
} from '@/models/app'
|
||||
import type { BackendModel, ProviderMap } from '@/app/components/header/account-setting/model-page/declarations'
|
||||
import type { RETRIEVE_METHOD } from '@/types/app'
|
||||
|
||||
export const login: Fetcher<CommonResponse & { data: string }, { url: string; body: Record<string, any> }> = ({ url, body }) => {
|
||||
return post(url, { body }) as Promise<CommonResponse & { data: string }>
|
||||
@@ -237,3 +238,10 @@ export const fetchCodeBasedExtensionList: Fetcher<CodeBasedExtension, string> =
|
||||
export const moderate = (url: string, body: { app_id: string; text: string }) => {
|
||||
return post(url, { body }) as Promise<ModerateResponse>
|
||||
}
|
||||
|
||||
type RetrievalMethodsRes = {
|
||||
'retrieval_method': RETRIEVE_METHOD[]
|
||||
}
|
||||
export const fetchSupportRetrievalMethods: Fetcher<RetrievalMethodsRes, string> = (url) => {
|
||||
return get<RetrievalMethodsRes>(url)
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ import type {
|
||||
ApikeysListResponse,
|
||||
CreateApiKeyResponse,
|
||||
} from '@/models/app'
|
||||
import type { RetrievalConfig } from '@/types/app'
|
||||
|
||||
// apis for documents in a dataset
|
||||
|
||||
@@ -48,7 +49,7 @@ export const fetchDatasetDetail: Fetcher<DataSet, string> = (datasetId: string)
|
||||
return get<DataSet>(`/datasets/${datasetId}`)
|
||||
}
|
||||
|
||||
export const updateDatasetSetting: Fetcher<DataSet, { datasetId: string; body: Partial<Pick<DataSet, 'name' | 'description' | 'permission' | 'indexing_technique'>> }> = ({ datasetId, body }) => {
|
||||
export const updateDatasetSetting: Fetcher<DataSet, { datasetId: string; body: Partial<Pick<DataSet, 'name' | 'description' | 'permission' | 'indexing_technique' | 'retrieval_model'>> }> = ({ datasetId, body }) => {
|
||||
return patch<DataSet>(`/datasets/${datasetId}`, { body })
|
||||
}
|
||||
|
||||
@@ -182,8 +183,8 @@ export const checkSegmentBatchImportProgress: Fetcher<{ job_id: string; job_stat
|
||||
}
|
||||
|
||||
// hit testing
|
||||
export const hitTesting: Fetcher<HitTestingResponse, { datasetId: string; queryText: string }> = ({ datasetId, queryText }) => {
|
||||
return post<HitTestingResponse>(`/datasets/${datasetId}/hit-testing`, { body: { query: queryText } })
|
||||
export const hitTesting: Fetcher<HitTestingResponse, { datasetId: string; queryText: string; retrieval_model: RetrievalConfig }> = ({ datasetId, queryText, retrieval_model }) => {
|
||||
return post<HitTestingResponse>(`/datasets/${datasetId}/hit-testing`, { body: { query: queryText, retrieval_model } })
|
||||
}
|
||||
|
||||
export const fetchTestingRecords: Fetcher<HitTestingRecordsResponse, { datasetId: string; params: { page: number; limit: number } }> = ({ datasetId, params }) => {
|
||||
|
||||
Reference in New Issue
Block a user