feat: log image descriptions at INFO level for debugging
Show the generated (or cached) image description in logs so users can verify what the vision model produced and diagnose issues. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
bc45e31227
commit
4c73ae213b
1 changed files with 9 additions and 1 deletions
|
|
@ -262,7 +262,10 @@ func (al *AgentLoop) describeImage(
|
||||||
hash := mediacache.HashData([]byte(dataURL))
|
hash := mediacache.HashData([]byte(dataURL))
|
||||||
if al.mediaCache != nil {
|
if al.mediaCache != nil {
|
||||||
if cached, ok := al.mediaCache.Get(hash, mediacache.TypeImageDesc); ok {
|
if cached, ok := al.mediaCache.Get(hash, mediacache.TypeImageDesc); ok {
|
||||||
logger.DebugCF("agent", "Image description cache hit", map[string]any{"hash": hash})
|
logger.InfoCF("agent", "Image description (cached)", map[string]any{
|
||||||
|
"hash": hash,
|
||||||
|
"description": cached,
|
||||||
|
})
|
||||||
return cached
|
return cached
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -317,6 +320,11 @@ func (al *AgentLoop) describeImage(
|
||||||
|
|
||||||
desc := strings.TrimSpace(resp.Content)
|
desc := strings.TrimSpace(resp.Content)
|
||||||
|
|
||||||
|
logger.InfoCF("agent", "Image described", map[string]any{
|
||||||
|
"hash": hash,
|
||||||
|
"description": desc,
|
||||||
|
})
|
||||||
|
|
||||||
// Store in cache
|
// Store in cache
|
||||||
if al.mediaCache != nil {
|
if al.mediaCache != nil {
|
||||||
if cErr := al.mediaCache.Put(hash, mediacache.TypeImageDesc, desc); cErr != nil {
|
if cErr := al.mediaCache.Put(hash, mediacache.TypeImageDesc, desc); cErr != nil {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue