From b0a9952785a6640c9a4cefb31ca3eceff935e9fa Mon Sep 17 00:00:00 2001 From: wizardchen Date: Wed, 31 Dec 2025 13:44:23 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E7=A6=81=E7=94=A8?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=A0=87=E9=A2=98=E7=94=9F=E6=88=90=E7=9A=84?= =?UTF-8?q?=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/session.go | 1 + internal/handler/session/qa.go | 6 +++--- internal/handler/session/types.go | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/client/session.go b/client/session.go index 98cff9140..751fd3489 100644 --- a/client/session.go +++ b/client/session.go @@ -235,6 +235,7 @@ type KnowledgeQARequest struct { AgentID string `json:"agent_id"` // Selected custom agent ID for this request WebSearchEnabled bool `json:"web_search_enabled"` // Whether web search is enabled for this request SummaryModelID string `json:"summary_model_id"` // Optional summary model ID (overrides session default) + DisableTitle bool `json:"disable_title"` // Whether to disable auto title generation } type ResponseType string diff --git a/internal/handler/session/qa.go b/internal/handler/session/qa.go index 93719473f..5d7d653a8 100644 --- a/internal/handler/session/qa.go +++ b/internal/handler/session/qa.go @@ -250,14 +250,14 @@ func (h *Handler) SearchKnowledge(c *gin.Context) { // @Router /sessions/{session_id}/knowledge-qa [post] func (h *Handler) KnowledgeQA(c *gin.Context) { // Parse and validate request - reqCtx, _, err := h.parseQARequest(c, "KnowledgeQA") + reqCtx, request, err := h.parseQARequest(c, "KnowledgeQA") if err != nil { c.Error(err) return } - // Execute normal mode QA - h.executeNormalModeQA(reqCtx, true) + // Execute normal mode QA, generate title unless disabled + h.executeNormalModeQA(reqCtx, !request.DisableTitle) } // AgentQA godoc diff --git a/internal/handler/session/types.go b/internal/handler/session/types.go index d0492ddbb..709896dc7 100644 --- a/internal/handler/session/types.go +++ b/internal/handler/session/types.go @@ -69,6 +69,7 @@ type CreateKnowledgeQARequest struct { WebSearchEnabled bool `json:"web_search_enabled"` // Whether web search is enabled for this request SummaryModelID string `json:"summary_model_id"` // Optional summary model ID for this request (overrides session default) MentionedItems []MentionedItemRequest `json:"mentioned_items"` // @mentioned knowledge bases and files + DisableTitle bool `json:"disable_title"` // Whether to disable auto title generation } // SearchKnowledgeRequest defines the request structure for searching knowledge without LLM summarization