mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: Refactor ag-ui to clean up some patterns (#2363)
* Refactor ag-ui to clean up some patterns * Mypy fixes * Fix imports, typing, tests, logging. * Fix test import error * Fix imports again * Fix thread handling
This commit is contained in:
committed by
GitHub
Unverified
parent
6c624319db
commit
8cf8b0f995
@@ -2,6 +2,8 @@
|
||||
|
||||
"""Tests for backend tool rendering."""
|
||||
|
||||
from typing import cast
|
||||
|
||||
from ag_ui.core import (
|
||||
TextMessageContentEvent,
|
||||
TextMessageStartEvent,
|
||||
@@ -119,6 +121,9 @@ async def test_multiple_tool_results():
|
||||
assert isinstance(events[end_idx], ToolCallEndEvent)
|
||||
assert isinstance(events[result_idx], ToolCallResultEvent)
|
||||
|
||||
assert events[end_idx].tool_call_id == f"tool-{i + 1}"
|
||||
assert events[result_idx].tool_call_id == f"tool-{i + 1}"
|
||||
assert f"Result {i + 1}" in events[result_idx].content
|
||||
end_event = cast(ToolCallEndEvent, events[end_idx])
|
||||
result_event = cast(ToolCallResultEvent, events[result_idx])
|
||||
|
||||
assert end_event.tool_call_id == f"tool-{i + 1}"
|
||||
assert result_event.tool_call_id == f"tool-{i + 1}"
|
||||
assert f"Result {i + 1}" in result_event.content
|
||||
|
||||
Reference in New Issue
Block a user