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
+9 -1
View File
@@ -1,6 +1,7 @@
package tools
import (
"encoding/json"
"fmt"
"github.com/Tencent/WeKnora/internal/types"
@@ -10,13 +11,15 @@ import (
type BaseTool struct {
name string
description string
schema json.RawMessage
}
// NewBaseTool creates a new base tool
func NewBaseTool(name, description string) BaseTool {
func NewBaseTool(name, description string, schema json.RawMessage) BaseTool {
return BaseTool{
name: name,
description: description,
schema: schema,
}
}
@@ -30,6 +33,11 @@ func (t *BaseTool) Description() string {
return t.description
}
// Parameters returns the tool parameters schema
func (t *BaseTool) Parameters() json.RawMessage {
return t.schema
}
// ToolExecutor is a helper interface for executing tools
type ToolExecutor interface {
types.Tool