feat: Add DataSchema tool for retrieving schema information from CSV and Excel files

This commit is contained in:
begoniezhao
2025-12-23 16:56:30 +08:00
parent ddf5ae4e65
commit 907e9a5522
51 changed files with 2784 additions and 1307 deletions
@@ -1030,7 +1030,7 @@ func (s *knowledgeBaseService) processSearchResults(ctx context.Context,
}
// Add nearby chunks (prev and next)
if chunk.ChunkType == types.ChunkTypeText {
if slices.Contains([]string{types.ChunkTypeText}, chunk.ChunkType) {
if chunk.NextChunkID != "" && !processedChunkIDs[chunk.NextChunkID] {
additionalChunkIDs = append(additionalChunkIDs, chunk.NextChunkID)
processedChunkIDs[chunk.NextChunkID] = true
@@ -1163,6 +1163,7 @@ func (s *knowledgeBaseService) buildSearchResult(chunk *types.Chunk,
func (s *knowledgeBaseService) isValidTextChunk(chunk *types.Chunk) bool {
return slices.Contains([]types.ChunkType{
types.ChunkTypeText, types.ChunkTypeSummary,
types.ChunkTypeTableColumn, types.ChunkTypeTableSummary,
types.ChunkTypeFAQ,
}, chunk.ChunkType)
}