mirror of
https://gitcode.com/JianFeeeee/HomeAgent.git
synced 2026-09-22 18:08:04 +00:00
- P0-1: ProviderError type + ReportStatus for precise 401/403 detection - P0-2: Remove -config flag from deploy/homeagent.service - P2-1: 5s debounce on context.go Save() - P2-2→C1: Delete output_set_channel entirely - P2-3: Extract mediaDataURL/mediaChat helpers - P2-4: Dedup defaultSources var - P3: Delete dead packages (embed/tokenizer/container/snapshot) - P3: Delete dead functions (messagesToMap, RunStageAll) - CL: Update .gitignore, docs, Makefile, gojieba removal - Config: Delete config/config.yaml, update docs - Arch: Remove EmitOutputTo from emitResponse - CL-1: go.work 1.19→1.21 - Docs: Add Mermaid architecture diagrams to README - Docs: Add kernel-rebuild requires plugin-rebuild note to PLUGIN_DEV.md
27 lines
607 B
Go
27 lines
607 B
Go
package sdk
|
|
|
|
import agentAPI "gitcode.com/JianFeeeee/HomeAgent/internal/agent/api"
|
|
|
|
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()
|
|
}
|
|
|
|
var _ LLMAPI = (*llmImpl)(nil)
|