Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c73df74
feat(python): allow @tool functions to return rich content (images, a…
giles17 Feb 26, 2026
05f4fa6
Merge branch 'main' of https://github.com/giles17/agent-framework int…
giles17 Feb 26, 2026
7c97a91
Anthropic logging + mypy fix
giles17 Feb 26, 2026
2efe8aa
Merge branch 'main' into giles/tool-rich-content-results
giles17 Feb 27, 2026
55b5f52
Merge branch 'main' into giles/tool-rich-content-results
giles17 Mar 2, 2026
9bd8a15
Address PR review: fix MCP ordering, fold helper into from_function_r…
giles17 Mar 2, 2026
8e7352d
Use native Responses API multi-part output, warn+omit for Chat client
giles17 Mar 3, 2026
6869d02
Fix lint: remove print statement, wrap long line
giles17 Mar 3, 2026
ea93400
Merge branch 'main' into giles/tool-rich-content-results
giles17 Mar 3, 2026
9cdbdd8
Merge branch 'main' into giles/tool-rich-content-results
giles17 Mar 5, 2026
9ef5694
Merge branch 'main' into giles/tool-rich-content-results
giles17 Mar 5, 2026
fbc7756
Address review feedback: bug fixes, single-pass MCP, unit tests
giles17 Mar 5, 2026
888ff30
Fix pyright errors: add type ignore comments for Any list iteration
giles17 Mar 5, 2026
c8053aa
Merge branch 'main' into giles/tool-rich-content-results
giles17 Mar 6, 2026
099ceb6
Fix mypy/pyright: ensure ToolExecutionException receives str
giles17 Mar 6, 2026
b15d92a
Merge branch 'main' into giles/tool-rich-content-results
giles17 Mar 9, 2026
4dc062a
Fix lint: remove duplicate test_prepare_options_excludes_conversation_id
giles17 Mar 9, 2026
f33279d
refactor: unify all tool results into Content items
giles17 Mar 9, 2026
4af442d
addressed copilot comments
giles17 Mar 9, 2026
9e21d01
pyright fix
giles17 Mar 9, 2026
1a52bca
small fix
giles17 Mar 10, 2026
f4dcf33
comments
giles17 Mar 10, 2026
7358ebf
fix: address Copilot review - warnings, blob safety, dedup
giles17 Mar 10, 2026
5aa1c25
Merge branch 'main' into giles/tool-rich-content-results
giles17 Mar 11, 2026
b086455
Merge branch 'main' into giles/tool-rich-content-results
giles17 Mar 12, 2026
03d5df8
Merge branch 'main' into giles/tool-rich-content-results
giles17 Mar 12, 2026
29d5c63
Fix token double-counting in compaction and address review comments
giles17 Mar 12, 2026
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
2 changes: 1 addition & 1 deletion python/packages/ag-ui/tests/ag_ui/test_event_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def test_tool_call_result_event(self) -> None:
assert update.role == "tool"
assert len(update.contents) == 1
assert update.contents[0].call_id == "call_123"
assert update.contents[0].result == {"temperature": 22, "condition": "sunny"}
assert update.contents[0].result == '{"temperature": 22, "condition": "sunny"}'

def test_run_finished_event(self) -> None:
"""Test conversion of RUN_FINISHED event."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -716,12 +716,46 @@ def _prepare_message_for_anthropic(self, message: Message) -> dict[str, Any]:
"input": content.parse_arguments(),
})
case "function_result":
a_content.append({
"type": "tool_result",
"tool_use_id": content.call_id,
"content": content.result if content.result is not None else "",
"is_error": content.exception is not None,
})
if content.items:
tool_content: list[dict[str, Any]] = []
for item in content.items:
if item.type == "text":
tool_content.append({"type": "text", "text": item.text or ""})
elif item.type == "data" and item.has_top_level_media_type("image"):
tool_content.append({
"type": "image",
"source": {
"data": _get_data_bytes_as_str(item), # type: ignore[attr-defined]
"media_type": item.media_type,
"type": "base64",
},
})
elif item.type == "uri" and item.has_top_level_media_type("image"):
tool_content.append({
"type": "image",
"source": {"type": "url", "url": item.uri},
})
Comment thread
giles17 marked this conversation as resolved.
else:
logger.debug(
"Ignoring unsupported rich content media type in tool result: %s",
item.media_type,
)
tool_result_content = (
tool_content if tool_content else (content.result if content.result is not None else "")
)
a_content.append({
"type": "tool_result",
"tool_use_id": content.call_id,
"content": tool_result_content,
"is_error": content.exception is not None,
})
else:
a_content.append({
"type": "tool_result",
"tool_use_id": content.call_id,
"content": content.result if content.result is not None else "",
"is_error": content.exception is not None,
})
case "mcp_server_tool_call":
mcp_call: dict[str, Any] = {
"type": "mcp_tool_use",
Expand Down
Loading
Loading