mirror of
https://gitcode.com/JianFeeeee/HomeAgent.git
synced 2026-10-14 19:43:37 +00:00
feat: converge dynamic plugins onto canonical homeagent-sdk
- Separate built-in plugin interface from external plugin interface - Route dynamic plugin loading through homeagent-sdk/sdk using reflection - Turn internal/sdk into an enhanced wrapper over canonical SDK types - Vendor SDK repo snapshot under third_party/homeagent-sdk for stable builds - Keep internal constructors/adapters for memory, knowledge, llm, settings - Align dynamic QQ loading with canonical SDK chain
This commit is contained in:
@ -1,42 +1,29 @@
|
||||
package sdk
|
||||
|
||||
import agentAPI "gitcode.com/JianFeeeee/HomeAgent/internal/agent/api"
|
||||
import (
|
||||
sdkext "gitcode.com/JianFeeeee/homeagent-sdk/sdk"
|
||||
agentAPI "gitcode.com/JianFeeeee/HomeAgent/internal/agent/api"
|
||||
)
|
||||
|
||||
type LLMAPI interface {
|
||||
ListSources() []string
|
||||
SetSource(name string) error
|
||||
CurrentSource() string
|
||||
}
|
||||
type LLMAPI = sdkext.LLMAPI
|
||||
|
||||
type llmImpl struct {
|
||||
mgr *agentAPI.ProviderManager
|
||||
}
|
||||
type llmImpl struct{ mgr *agentAPI.ProviderManager }
|
||||
|
||||
func NewLLM(mgr *agentAPI.ProviderManager) LLMAPI {
|
||||
return &llmImpl{mgr: mgr}
|
||||
}
|
||||
func NewLLM(mgr *agentAPI.ProviderManager) LLMAPI { return &llmImpl{mgr: mgr} }
|
||||
|
||||
func (l *llmImpl) ListSources() []string {
|
||||
if l.mgr == nil {
|
||||
return nil
|
||||
}
|
||||
if l.mgr == nil { return nil }
|
||||
return l.mgr.List()
|
||||
}
|
||||
|
||||
func (l *llmImpl) SetSource(name string) error {
|
||||
if l.mgr == nil {
|
||||
return nil
|
||||
}
|
||||
if l.mgr == nil { return nil }
|
||||
return l.mgr.SetDefault(name)
|
||||
}
|
||||
|
||||
func (l *llmImpl) CurrentSource() string {
|
||||
if l.mgr == nil {
|
||||
return ""
|
||||
}
|
||||
if l.mgr == nil { return "" }
|
||||
p := l.mgr.Default()
|
||||
if p == nil {
|
||||
return ""
|
||||
}
|
||||
if p == nil { return "" }
|
||||
return p.Name()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user