feat: 添加禁用自动标题生成的选项
This commit is contained in:
@@ -235,6 +235,7 @@ type KnowledgeQARequest struct {
|
|||||||
AgentID string `json:"agent_id"` // Selected custom agent ID for this request
|
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
|
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)
|
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
|
type ResponseType string
|
||||||
|
|||||||
@@ -250,14 +250,14 @@ func (h *Handler) SearchKnowledge(c *gin.Context) {
|
|||||||
// @Router /sessions/{session_id}/knowledge-qa [post]
|
// @Router /sessions/{session_id}/knowledge-qa [post]
|
||||||
func (h *Handler) KnowledgeQA(c *gin.Context) {
|
func (h *Handler) KnowledgeQA(c *gin.Context) {
|
||||||
// Parse and validate request
|
// Parse and validate request
|
||||||
reqCtx, _, err := h.parseQARequest(c, "KnowledgeQA")
|
reqCtx, request, err := h.parseQARequest(c, "KnowledgeQA")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.Error(err)
|
c.Error(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute normal mode QA
|
// Execute normal mode QA, generate title unless disabled
|
||||||
h.executeNormalModeQA(reqCtx, true)
|
h.executeNormalModeQA(reqCtx, !request.DisableTitle)
|
||||||
}
|
}
|
||||||
|
|
||||||
// AgentQA godoc
|
// AgentQA godoc
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ type CreateKnowledgeQARequest struct {
|
|||||||
WebSearchEnabled bool `json:"web_search_enabled"` // Whether web search is enabled 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 for this request (overrides session default)
|
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
|
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
|
// SearchKnowledgeRequest defines the request structure for searching knowledge without LLM summarization
|
||||||
|
|||||||
Reference in New Issue
Block a user