feat(tools): local-first document extraction for read_document

Squash merge PR #111 after resolving docs/changelog conflicts. Local checks covered tools/config and both Go builds; PR CI run 26704622503 passed release-versioning, go, and web.
This commit is contained in:
Duy /zuey/ authored and GitHub committed 2026-05-31 12:55:38 +07:00
1 parent 80893a1e6c
commit 9ab3d6dfe5
9 files changed
+770 -2

No files matched your search

+7
View File
@@ -10,6 +10,7 @@ import (
"github.com/google/uuid"
"strings"
"time"
"github.com/nextlevelbuilder/goclaw/internal/agent"
"github.com/nextlevelbuilder/goclaw/internal/bus"
@@ -86,6 +87,12 @@ func wireExtras(
// Register media analysis tools (need mediaStore for file access).
readDocumentTool := tools.NewReadDocumentTool(providerReg, mediaStore)
readDocumentTool.SetUsageCapService(usageCapSvc)
readDocumentTool.SetLocalParser(tools.NewLocalExtractParser(tools.LocalExtractConfig{
Enabled: appCfg.Tools.DocumentParser.LocalFirstEnabled(),
MaxPages: appCfg.Tools.DocumentParser.MaxPages,
Timeout: time.Duration(appCfg.Tools.DocumentParser.TimeoutSec) * time.Second,
MinTextLen: appCfg.Tools.DocumentParser.MinTextLen,
}))
toolsReg.Register(readDocumentTool)
readAudioTool := tools.NewReadAudioTool(providerReg, mediaStore)
readAudioTool.SetUsageCapService(usageCapSvc)