mirror of
https://github.com/Tencent/WeKnora.git
synced 2026-06-04 13:30:32 +08:00
refactor: Rename Title field to KnowledgeTitle and update JSON/GORM tags for clarity
This commit is contained in:
@@ -247,8 +247,8 @@ func (t *GrepChunksTool) Execute(ctx context.Context, args map[string]interface{
|
||||
|
||||
type chunkWithTitle struct {
|
||||
types.Chunk
|
||||
Title string
|
||||
MatchScore float64 // Score based on match count and position
|
||||
KnowledgeTitle string `json:"knowledge_title" gorm:"column:knowledge_title"`
|
||||
MatchScore float64 `json:"match_score" gorm:"column:match_score"` // Score based on match count and position
|
||||
}
|
||||
|
||||
// searchChunks performs the database search with pattern matching
|
||||
@@ -356,7 +356,7 @@ func (t *GrepChunksTool) formatOutput(
|
||||
for _, result := range results {
|
||||
knowledgeID := fmt.Sprintf("%v", result.KnowledgeID)
|
||||
title := "Untitled"
|
||||
if t := result.Title; t != "" {
|
||||
if t := result.KnowledgeTitle; t != "" {
|
||||
title = fmt.Sprintf("%v", t)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user