feat(plugins): add 10 tool plugins and wire full service stack in main.go
- plugins: calculator, datetime, crypto, random, text, json, markdown - plugins: web-search (SearXNG stub), web-fetch, file, http (stubs) - main.go: full wiring — config→db→nats→plugins→voice→memory→ persona→llm→context→subsession→orchestrator→gateway→ws - 15 packages passing, 11 plugins loaded at startup
This commit is contained in:
1 parent
3b3e5a0697
commit
192144563b
13 files changed
+477
-41
No files matched your search
@@ -0,0 +1,23 @@
|
||||
package datetime
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"git.yeij.top/AskaEth/Cyrene_v2/internal/plugin"
|
||||
)
|
||||
|
||||
type Plugin struct{}
|
||||
func New() *Plugin { return &Plugin{} }
|
||||
func (p *Plugin) Name() string { return "datetime" }
|
||||
func (p *Plugin) Version() string { return "1.0.0" }
|
||||
func (p *Plugin) Description() string { return "日期时间计算" }
|
||||
func (p *Plugin) Init(_ context.Context, _ plugin.PluginConfig) error { return nil }
|
||||
func (p *Plugin) Close() error { return nil }
|
||||
func (p *Plugin) Enabled() bool { return true }
|
||||
func (p *Plugin) Tools() []plugin.ToolDefinition {
|
||||
return []plugin.ToolDefinition{{Name:"datetime", Description:"获取当前日期时间", Parameters:map[string]any{}}}
|
||||
}
|
||||
func (p *Plugin) Execute(_ context.Context, _ string, _ map[string]any) (string, error) {
|
||||
return time.Now().Format("2006-01-02 15:04:05"), nil
|
||||
}
|
||||
Reference in new issue
Block a user