feat: add comprehensive logging for scene VLM tags parsing
- Log VLM response content (first 500 chars) - Log JSON extraction success/failure - Log JSON parsing success/failure - Log missing 'summary' field - Log parsed objects and tags count - Helps debug why vlm_tags may be empty in some cases
This commit is contained in:
@@ -653,6 +653,11 @@ Rules:
|
|||||||
None => anyhow::bail!("VLM returned empty content"),
|
None => anyhow::bail!("VLM returned empty content"),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
tracing::debug!(
|
||||||
|
"[Scene VLM] VLM response content (first 500 chars): {}",
|
||||||
|
&content[..content.len().min(500)]
|
||||||
|
);
|
||||||
|
|
||||||
// Parse structured JSON; fall back to heuristic extraction if it fails.
|
// Parse structured JSON; fall back to heuristic extraction if it fails.
|
||||||
if let Some(json_str) = Self::extract_json_object(&content) {
|
if let Some(json_str) = Self::extract_json_object(&content) {
|
||||||
tracing::debug!("[Scene VLM] Extracted JSON object ({} chars)", json_str.len());
|
tracing::debug!("[Scene VLM] Extracted JSON object ({} chars)", json_str.len());
|
||||||
@@ -681,8 +686,14 @@ Rules:
|
|||||||
tags.len()
|
tags.len()
|
||||||
);
|
);
|
||||||
return Ok((description, objects, tags));
|
return Ok((description, objects, tags));
|
||||||
|
} else {
|
||||||
|
tracing::warn!("[Scene VLM] JSON missing 'summary' field or summary is empty");
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
tracing::warn!("[Scene VLM] Failed to parse extracted JSON: {}", json_str);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
tracing::warn!("[Scene VLM] Failed to extract JSON object from VLM response");
|
||||||
}
|
}
|
||||||
|
|
||||||
tracing::warn!(
|
tracing::warn!(
|
||||||
|
|||||||
Reference in New Issue
Block a user