@@ -135,6 +135,61 @@ def _render_unit_markdown(unit: dict[str, Any]) -> str:
|
||||
return "\n".join(lines)
|
||||
|
||||
|
||||
# ============================================================================
|
||||
# Unit images renderer
|
||||
# ============================================================================
|
||||
|
||||
|
||||
def render_unit_images(payload: dict[str, Any], fmt: OutputFormat) -> str:
|
||||
"""Render unit images for visual assessment."""
|
||||
_validate_format(fmt)
|
||||
|
||||
if fmt == "json":
|
||||
return json.dumps(payload, indent=2, default=str)
|
||||
else:
|
||||
return _render_unit_images_markdown(payload)
|
||||
|
||||
|
||||
def _render_unit_images_markdown(data: dict[str, Any]) -> str:
|
||||
"""Render unit images as markdown with image references for Claude."""
|
||||
unit_code = data.get("unit_code", "Unknown")
|
||||
address = data.get("address", "Unknown")
|
||||
images = data.get("unit_images") or []
|
||||
|
||||
lines = [
|
||||
f"# Unit Images: {address}",
|
||||
"",
|
||||
f"**Unit Code:** {unit_code}",
|
||||
f"**Total Photos:** {len(images)}",
|
||||
"",
|
||||
"## Property Photos",
|
||||
"",
|
||||
]
|
||||
|
||||
if not images:
|
||||
lines.append("No images available for this unit.")
|
||||
else:
|
||||
lines.append("Below are the property images for visual assessment:")
|
||||
lines.append("")
|
||||
for i, img_url in enumerate(images, 1):
|
||||
lines.append(f"### Photo {i}")
|
||||
lines.append(f"")
|
||||
lines.append("")
|
||||
|
||||
lines.append("---")
|
||||
lines.append("")
|
||||
lines.append("**Analysis Notes:**")
|
||||
lines.append("Review the above photos to assess:")
|
||||
lines.append("- View quality (street, landscape, water, etc.)")
|
||||
lines.append("- Space and layout (openness, ceiling height, etc.)")
|
||||
lines.append("- Lighting and window placement")
|
||||
lines.append("- Condition and maintenance state")
|
||||
lines.append("- Kitchen and bathroom features")
|
||||
lines.append("- Overall atmosphere and livability")
|
||||
|
||||
return "\n".join(lines)
|
||||
|
||||
|
||||
# ============================================================================
|
||||
# Shortlist renderer
|
||||
# ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user