mirror of
https://gitcode.com/JianFeeeee/HomeAgent.git
synced 2026-09-23 02:18:06 +00:00
- 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
30 lines
660 B
Go
30 lines
660 B
Go
package sdk
|
|
|
|
import (
|
|
sdkext "gitcode.com/JianFeeeee/homeagent-sdk/sdk"
|
|
agentAPI "gitcode.com/JianFeeeee/HomeAgent/internal/agent/api"
|
|
)
|
|
|
|
type LLMAPI = sdkext.LLMAPI
|
|
|
|
type llmImpl struct{ mgr *agentAPI.ProviderManager }
|
|
|
|
func NewLLM(mgr *agentAPI.ProviderManager) LLMAPI { return &llmImpl{mgr: mgr} }
|
|
|
|
func (l *llmImpl) ListSources() []string {
|
|
if l.mgr == nil { return nil }
|
|
return l.mgr.List()
|
|
}
|
|
|
|
func (l *llmImpl) SetSource(name string) error {
|
|
if l.mgr == nil { return nil }
|
|
return l.mgr.SetDefault(name)
|
|
}
|
|
|
|
func (l *llmImpl) CurrentSource() string {
|
|
if l.mgr == nil { return "" }
|
|
p := l.mgr.Default()
|
|
if p == nil { return "" }
|
|
return p.Name()
|
|
}
|