feat: 支持知识库选择模式和标题生成模型配置

- 移除对rerankModel的强制检查,支持无知识库场景
- 优化知识库解析逻辑,优先处理用户明确指定的知识库
This commit is contained in:
wizardchen
2025-12-29 14:35:13 +08:00
parent 6bc19ab082
commit 6c8e261a5f
6 changed files with 92 additions and 44 deletions
+4 -2
View File
@@ -22,10 +22,12 @@ type SessionService interface {
// DeleteSession deletes a session
DeleteSession(ctx context.Context, id string) error
// GenerateTitle generates a title for the current conversation
GenerateTitle(ctx context.Context, session *types.Session, messages []types.Message) (string, error)
// modelID: optional model ID to use for title generation (if empty, uses first available KnowledgeQA model)
GenerateTitle(ctx context.Context, session *types.Session, messages []types.Message, modelID string) (string, error)
// GenerateTitleAsync generates a title for the session asynchronously
// It emits an event when the title is generated
GenerateTitleAsync(ctx context.Context, session *types.Session, userQuery string, eventBus *event.EventBus)
// modelID: optional model ID to use for title generation (if empty, uses first available KnowledgeQA model)
GenerateTitleAsync(ctx context.Context, session *types.Session, userQuery string, modelID string, eventBus *event.EventBus)
// KnowledgeQA performs knowledge-based question answering
// knowledgeBaseIDs: list of knowledge base IDs to search (supports multi-KB)
// knowledgeIDs: list of specific knowledge (file) IDs to search