Skip to content

Python a2ui_core: component state models, message processing and rendering#1578

Open
nan-yu wants to merge 8 commits into
a2ui-project:mainfrom
nan-yu:re-arch-5
Open

Python a2ui_core: component state models, message processing and rendering#1578
nan-yu wants to merge 8 commits into
a2ui-project:mainfrom
nan-yu:re-arch-5

Conversation

@nan-yu

@nan-yu nan-yu commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Description

Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.

List which issues are fixed by this PR. For larger changes, raising an issue first helps reduce redundant work.

Pre-launch Checklist

If you need help, consider asking for advice on the discussion board.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@jacobsimionato jacobsimionato left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Some initial feedback!! Overall this looks great, let me take another look tomorrow!

Comment thread agent_sdks/python/a2ui_core/src/a2ui/core/rendering/data_context.py
Comment thread agent_sdks/python/a2ui_core/src/a2ui/core/rendering/data_context.py Outdated
@nan-yu nan-yu force-pushed the re-arch-5 branch 4 times, most recently from b6dfdc8 to da119f6 Compare June 11, 2026 06:06
@nan-yu nan-yu requested a review from jacobsimionato June 11, 2026 06:08

@jacobsimionato jacobsimionato left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

NIce!!

self.on_updated.emit(self)

@property
def component_tree(self) -> Dict[str, Any]:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How is this different to properties above?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This maps the web-based implementation, https://github.com/a2ui-project/a2ui/blob/main/renderers/web_core/src/v0_9/state/component-model.ts#L68.

comp = ComponentModel("c1", "Button", {"label": "Click"})

assert comp.properties == {"label": "Click"}
assert comp.component_tree == {"id": "c1", "type": "Button", "label": "Click"}

Comment thread agent_sdks/python/a2ui_core/src/a2ui/core/state/data_model.py Outdated
return f"{SPEC_BASE_URL}/{ver.replace('.', '_')}/{file_name}"


class CatalogValidator:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe this could be MessageValidator? I get that it's catalog-specific, but to me, this name implies that it's validating catalog themselves.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

What about CatalogSchemaValidator? Classes like A2uiValidator (or a MessageValidator) operate at a higher protocol level to validate message structures. Since this class specifically validates individual message payloads (components, functions, and themes) against the schema definitions registered in the catalog, CatalogSchemaValidator feels more precise.

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.

2 participants