feat(llm): add LLM call recording with admin panel integration
- llm.Adapter: SetCallLogger hook for recording every API call - llm.CallLogger: ring-buffer with Recent+Stats for admin API - main.go: wire DeepSeek adapter to CallLogger - Fix: single CallLogger instance for both recording and display - Metrics: model name, duration, success/fail, tokens - All 16 packages pass
This commit is contained in:
1 parent
5b2bcc9441
commit
6a4887e52a
6 files changed
+131
-67
No files matched your search
@@ -6,7 +6,7 @@ package bridge
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
"git.yeij.top/AskaEth/Cyrene_v2/internal/logger"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sync"
|
||||
@@ -83,7 +83,7 @@ func (s *ConfigStore) StartWatching(interval time.Duration) {
|
||||
lastMod = info.ModTime()
|
||||
s.mu.Lock()
|
||||
if s.load() {
|
||||
log.Printf("[bridge] config hot-reloaded (%d adapters)", len(s.config.Adapters))
|
||||
logger.Infof("[bridge] config hot-reloaded (%d adapters)", len(s.config.Adapters))
|
||||
if s.onChange != nil {
|
||||
s.onChange(s.config)
|
||||
}
|
||||
@@ -184,7 +184,7 @@ func (s *ConfigStore) load() bool {
|
||||
}
|
||||
var cfg BridgeConfig
|
||||
if err := json.Unmarshal(data, &cfg); err != nil {
|
||||
log.Printf("[bridge] config parse error: %v", err)
|
||||
logger.Infof("[bridge] config parse error: %v", err)
|
||||
return false
|
||||
}
|
||||
if cfg.Adapters == nil {
|
||||
|
||||
Reference in new issue
Block a user