Skip to content

Conversation

@doitundoit
Copy link

Summary

This PR enables the rizzcharts sample agent with improved map support and significantly hardens the Lit client's message handling capabilities. It addresses issues with MIME type definitions and improves the client's ability to handle various data formats.

Changes

Rizzcharts Agent

Map Support: Updated agent.py and map.json to support map images, allowing for either Google Maps API integration or fallback placeholders.

Lit Client Improvements

Robust Message Handling:

  • Implemented a fallback mechanism to retrieve agent messages from history when needed.
  • Added support for parsing string-encoded JSON data parts.

Configuration:

  • Fixed the A2UI MIME type constant to application/json+a2ui.
  • Added debug logging (console.debug) for better traceability.

Demo Setup:

  • Added rizzcharts demo scripts and configuration to samples/client/lit/package.json.

Verification

  • Python: Verified syntax and build configuration for rizzcharts agent.
  • TypeScript: Successfully built the lit shell client (npm run build:tsc).

- Update rizzcharts agent to support map images (Google Maps API or placeholder).
- Add rizzcharts demo scripts and config to Lit client.
- Fix MIME type constant in client (application/json+a2ui).
- Improve client robustness: fallback to history for agent messages and handle string-encoded JSON data parts.
- Add debug logging to client.
@wrenj
Copy link
Collaborator

wrenj commented Dec 30, 2025

suyang/jon/yuzuru do you mind taking a look? thanks!

Copy link
Collaborator

@sugoi-yuzuru sugoi-yuzuru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All changes look good.

Thank you for noticing the json+a2aui MIME_TYPE issue. It seems it is more prevalent in the codebase that there are more places needed to be adjusted. Would you kindly isolate this small refactor into its own fix/refactor PR?

Changes for the lit looks good too. Can we isolate this change into its own PR to keep the scope of the commit as narrow and targetted as possible?

For Rizzcharts, the change look good too. However, I have some reservations in regards to sourcing image from an external service. Can we simply add a placeholder image within the codebase and use that instead of pointing to a thirdparty service?

"""
else:
map_image_instruction = """
**Map Image URL:** When constructing map visualizations, use a placeholder image URL exactly as shown in the example template. Do NOT attempt to use Google Maps Static API or any other external map service. Use exactly: `https://placehold.co/600x400?text=Map+Placeholder`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of depending on an external service, can we serve the image directly from the client app from the public directory? This will reduce concerns for placehold.co availability.

import { v0_8 } from "@a2ui/lit";

const A2AUI_MIME_TYPE = "application/json+a2aui";
const A2AUI_MIME_TYPE = "application/json+a2ui";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huge thanks for the fix.
Could we rename the const to A2UI_MIME_TYPE as well?

Also, it would be great if we can decouple this fix into its own PR to limit the scope of the commit for posterity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants