23 lines
695 B
TypeScript
23 lines
695 B
TypeScript
import { get, put } from '@/utils/request'
|
|||
|
|
|
||
|
|
// RetrievalConfig represents the global retrieval/search configuration for a tenant.
|
||
|
|
// Shared by knowledge search and message search.
|
||
|
|
export interface RetrievalConfig {
|
||
|
|
embedding_top_k: number
|
||
|
|
vector_threshold: number
|
||
|
|
keyword_threshold: number
|
||
|
|
rerank_top_k: number
|
||
|
|
rerank_threshold: number
|
||
|
|
rerank_model_id: string
|
||
|
|
}
|
||
|
|
|
||
|
|
// Get tenant retrieval config via KV API
|
||
|
|
export function getTenantRetrievalConfig() {
|
||
|
|
return get('/api/v1/tenants/kv/retrieval-config')
|
||
|
|
}
|
||
|
|
|
||
|
|
// Update tenant retrieval config via KV API
|
||
|
|
export function updateTenantRetrievalConfig(config: RetrievalConfig) {
|
||
|
|
return put('/api/v1/tenants/kv/retrieval-config', config)
|
||
|
|
}
|