Python: AG-UI deterministic state updates from tool results (#5201)

* AG-UI deterministic state updates from tool results

* fix(ag-ui): address PR #5201 review comments

1. Add missing AGUIEventConverter, AGUIHttpService, __version__ to
   _IMPORTS in core ag_ui lazy-export list to match the .pyi stub.

2. Coalesce predictive and deterministic state snapshots into a single
   StateSnapshotEvent when both mechanisms are active on the same tool
   result, reducing redundant snapshot traffic.

3. Update state_update() docstring to clarify that a predictive snapshot
   may be emitted before the deterministic one when predict_state_config
   is active.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Evan Mattson
2026-04-14 13:58:09 +09:00
committed by GitHub
Unverified
parent 3c31ac28b5
commit f183f888a3
11 changed files with 878 additions and 4 deletions
@@ -7,10 +7,13 @@ This module lazily re-exports objects from:
Supported classes and functions:
- AgentFrameworkAgent
- AgentFrameworkWorkflow
- AGUIChatClient
- AGUIEventConverter
- AGUIHttpService
- add_agent_framework_fastapi_endpoint
- state_update
- __version__
"""
import importlib
@@ -23,6 +26,10 @@ _IMPORTS = [
"AgentFrameworkWorkflow",
"add_agent_framework_fastapi_endpoint",
"AGUIChatClient",
"AGUIEventConverter",
"AGUIHttpService",
"state_update",
"__version__",
]
@@ -8,6 +8,7 @@ from agent_framework_ag_ui import (
AGUIHttpService,
__version__,
add_agent_framework_fastapi_endpoint,
state_update,
)
__all__ = [
@@ -18,4 +19,5 @@ __all__ = [
"AgentFrameworkWorkflow",
"__version__",
"add_agent_framework_fastapi_endpoint",
"state_update",
]