refactor(agent): remove query display from DatabaseQuery component and update tool result structure
- Removed the query display section from the DatabaseQuery component to streamline the UI. - Updated the DatabaseQueryData interface to eliminate the query field, reflecting changes in tool result handling. - Enhanced the DatabaseQuery tool execution to focus on returning structured results without exposing raw SQL queries. - Added a new utility to strip <think> blocks from LLM outputs, improving content clarity and user experience.
This commit is contained in:
@@ -471,11 +471,10 @@ func (s *agentService) getKnowledgeBaseInfos(ctx context.Context, kbIDs []string
|
||||
kb, err := s.knowledgeBaseService.GetKnowledgeBaseByID(ctx, kbID)
|
||||
if err != nil {
|
||||
logger.Warnf(ctx, "Failed to get knowledge base %s: %v", secutils.SanitizeForLog(kbID), err)
|
||||
// Add fallback info
|
||||
kbInfos = append(kbInfos, &agent.KnowledgeBaseInfo{
|
||||
ID: kbID,
|
||||
Name: kbID,
|
||||
Type: "document", // Default type
|
||||
Type: "document",
|
||||
Description: "",
|
||||
DocCount: 0,
|
||||
RecentDocs: []agent.RecentDocInfo{},
|
||||
@@ -483,6 +482,12 @@ func (s *agentService) getKnowledgeBaseInfos(ctx context.Context, kbIDs []string
|
||||
continue
|
||||
}
|
||||
|
||||
// Skip hidden/system-managed knowledge bases (e.g., __chat_history__)
|
||||
if kb.IsTemporary {
|
||||
logger.Debugf(ctx, "Skipping temporary knowledge base %s (%s) from prompt", kb.ID, kb.Name)
|
||||
continue
|
||||
}
|
||||
|
||||
// Get document count and recent documents
|
||||
docCount := 0
|
||||
recentDocs := []agent.RecentDocInfo{}
|
||||
|
||||
Reference in New Issue
Block a user