Add knowledge retrieval configuration to Assistant model and related components
- Introduce new fields for knowledge retrieval configuration in AssistantConfig and Assistant models, including mode, top_n, and score_threshold. - Implement KnowledgeRetrievalConfig schema with validation for top_n. - Update backend services and routes to handle knowledge retrieval settings. - Enhance frontend components to support knowledge retrieval configuration, including a new dialog for advanced settings. - Add tests for knowledge retrieval configuration validation and description generation.
This commit is contained in:
@@ -180,6 +180,7 @@ export type Assistant = {
|
||||
visionModelResourceId: string | null;
|
||||
modelResourceIds: Partial<Record<ModelType, string>>;
|
||||
knowledgeBaseId: string | null;
|
||||
knowledgeRetrievalConfig: KnowledgeRetrievalConfig;
|
||||
toolIds: string[];
|
||||
prompt: string;
|
||||
apiUrl: string;
|
||||
@@ -189,6 +190,12 @@ export type Assistant = {
|
||||
updatedAt?: string | null;
|
||||
};
|
||||
|
||||
export type KnowledgeRetrievalConfig = {
|
||||
mode: "automatic" | "on_demand";
|
||||
topN: number;
|
||||
scoreThreshold: number;
|
||||
};
|
||||
|
||||
export type AssistantUpsert = Omit<Assistant, "id" | "updatedAt">;
|
||||
|
||||
export const assistantsApi = {
|
||||
|
||||
Reference in New Issue
Block a user