Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions agent_sdks/python/src/a2ui/core/parser/streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -1232,8 +1232,7 @@ def traverse(obj, parent_key=None):
"id": placeholder_id,
"component": {
"Text": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

If it's empty, do we need to keep the text components at all? And if we need something to show, couldn't it be a Row with no children or something? And since they're all identical, they could be defined once.

"text": {"literalString": f"Loading {child_id}..."},
"usageHint": "caption",
"text": {"literalString": ""},
}
},
}
Expand All @@ -1255,8 +1254,7 @@ def traverse(obj, parent_key=None):
"id": placeholder_id,
"component": {
"Text": {
"text": {"literalString": "Loading children..."},
"usageHint": "caption",
"text": {"literalString": ""},
}
},
}
Expand All @@ -1272,8 +1270,7 @@ def traverse(obj, parent_key=None):
"id": placeholder_id,
"component": {
"Text": {
"text": {"literalString": f"Loading {child_id}..."},
"usageHint": "caption",
"text": {"literalString": ""},
}
},
}
Expand Down
39 changes: 13 additions & 26 deletions agent_sdks/python/tests/core/parser/test_streaming_v08.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,7 @@ def test_incremental_yielding_v08(mock_catalog):
"id": "loading_children_root-column",
"component": {
"Text": {
"text": {"literalString": "Loading children..."},
"usageHint": "caption",
"text": {"literalString": ""},
}
},
},
Expand All @@ -347,8 +346,7 @@ def test_incremental_yielding_v08(mock_catalog):
"id": "loading_c1",
"component": {
"Text": {
"text": {"literalString": "Loading c1..."},
"usageHint": "caption",
"text": {"literalString": ""},
}
},
},
Expand All @@ -375,17 +373,15 @@ def test_incremental_yielding_v08(mock_catalog):
"id": "loading_c1",
"component": {
"Text": {
"text": {"literalString": "Loading c1..."},
"usageHint": "caption",
"text": {"literalString": ""},
}
},
},
{
"id": "loading_c2",
"component": {
"Text": {
"text": {"literalString": "Loading c2..."},
"usageHint": "caption",
"text": {"literalString": ""},
}
},
},
Expand Down Expand Up @@ -428,8 +424,7 @@ def test_incremental_yielding_v08(mock_catalog):
"id": "loading_c2",
"component": {
"Text": {
"text": {"literalString": "Loading c2..."},
"usageHint": "caption",
"text": {"literalString": ""},
}
},
},
Expand Down Expand Up @@ -813,8 +808,7 @@ def test_partial_single_child_string(mock_catalog):
"id": "loading_c1",
"component": {
"Text": {
"text": {"literalString": "Loading c1..."},
"usageHint": "caption",
"text": {"literalString": ""},
}
},
},
Expand Down Expand Up @@ -886,8 +880,7 @@ def test_partial_template_componentId(mock_catalog):
"id": "loading_c1",
"component": {
"Text": {
"text": {"literalString": "Loading c1..."},
"usageHint": "caption",
"text": {"literalString": ""},
}
},
},
Expand Down Expand Up @@ -959,26 +952,23 @@ def test_partial_children_lists(mock_catalog):
"id": "loading_c1",
"component": {
"Text": {
"text": {"literalString": "Loading c1..."},
"usageHint": "caption",
"text": {"literalString": ""},
}
},
},
{
"id": "loading_c2",
"component": {
"Text": {
"text": {"literalString": "Loading c2..."},
"usageHint": "caption",
"text": {"literalString": ""},
}
},
},
{
"id": "loading_c3",
"component": {
"Text": {
"text": {"literalString": "Loading c3..."},
"usageHint": "caption",
"text": {"literalString": ""},
}
},
},
Expand Down Expand Up @@ -1015,17 +1005,15 @@ def test_partial_children_lists(mock_catalog):
"id": "loading_c2",
"component": {
"Text": {
"text": {"literalString": "Loading c2..."},
"usageHint": "caption",
"text": {"literalString": ""},
}
},
},
{
"id": "loading_c3",
"component": {
"Text": {
"text": {"literalString": "Loading c3..."},
"usageHint": "caption",
"text": {"literalString": ""},
}
},
},
Expand Down Expand Up @@ -2075,8 +2063,7 @@ def test_sniff_partial_component_discards_empty_children_dict(mock_catalog):
{
"component": {
"Text": {
"text": {"literalString": "Loading item-list..."},
"usageHint": "caption",
"text": {"literalString": ""},
}
},
"id": "loading_item-list",
Expand Down
Loading