Skip to content

Commit 4939119

Browse files
committed
fix(agui_protocol): import run event classes directly
the runstartedevent and runfinishedevent classes are now imported directly from ag_ui.core to ensure proper event handling in the sse stream. these events are essential for signaling the start and completion of runs within the agui protocol, improving reliability and maintainability of the streaming mechanism. 修复了 agui 协议中运行事件类的导入问题,确保 SSE 流能够正确处理运行开始和结束事件。此举增强了流机制的可靠性和可维护性。 Change-Id: Ied78843c9533c640a4706b379c8bd9109acc3b0b Signed-off-by: OhYee <[email protected]>
1 parent 8e105ed commit 4939119

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

agentrun/model/model.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ class ProxyConfigTokenRateLimiter(BaseModel):
131131

132132
class ProxyConfigAIGuardrailConfig(BaseModel):
133133
"""AI 防护配置"""
134+
134135
check_request: Optional[bool] = None
135136
check_response: Optional[bool] = None
136137

agentrun/server/agui_protocol.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,8 @@ async def _format_stream(
347347
Yields:
348348
SSE 格式的字符串
349349
"""
350+
from ag_ui.core import RunFinishedEvent, RunStartedEvent
351+
350352
state = StreamStateMachine()
351353

352354
# 发送 RUN_STARTED

0 commit comments

Comments
 (0)