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 {
|
type chunkWithTitle struct {
|
||||||
types.Chunk
|
types.Chunk
|
||||||
Title string
|
KnowledgeTitle string `json:"knowledge_title" gorm:"column:knowledge_title"`
|
||||||
MatchScore float64 // Score based on match count and position
|
MatchScore float64 `json:"match_score" gorm:"column:match_score"` // Score based on match count and position
|
||||||
}
|
}
|
||||||
|
|
||||||
// searchChunks performs the database search with pattern matching
|
// searchChunks performs the database search with pattern matching
|
||||||
@@ -356,7 +356,7 @@ func (t *GrepChunksTool) formatOutput(
|
|||||||
for _, result := range results {
|
for _, result := range results {
|
||||||
knowledgeID := fmt.Sprintf("%v", result.KnowledgeID)
|
knowledgeID := fmt.Sprintf("%v", result.KnowledgeID)
|
||||||
title := "Untitled"
|
title := "Untitled"
|
||||||
if t := result.Title; t != "" {
|
if t := result.KnowledgeTitle; t != "" {
|
||||||
title = fmt.Sprintf("%v", t)
|
title = fmt.Sprintf("%v", t)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user