Python: [BREAKING] simplify ag-ui run logic, fix mcp bugs, fix anthropic client issues in ag-ui (#3322)

* Refactor ag-ui to simplify flow

* Refactoring

* Fix backend tool

* Update tests

* Improvements

* Fix mypy

* Fixes

* Fix json serialize errors
This commit is contained in:
Evan Mattson
2026-01-23 14:10:46 +09:00
committed by GitHub
Unverified
parent 9f893a32a6
commit 5436354a83
42 changed files with 2789 additions and 5395 deletions
@@ -146,6 +146,7 @@ class AnthropicChatOptions(ChatOptions, total=False):
frequency_penalty: None # type: ignore[misc]
presence_penalty: None # type: ignore[misc]
store: None # type: ignore[misc]
conversation_id: None # type: ignore[misc]
TAnthropicOptions = TypeVar(
@@ -513,7 +514,9 @@ class AnthropicClient(BaseChatClient[TAnthropicOptions], Generic[TAnthropicOptio
for content in message.contents:
match content.type:
case "text":
a_content.append({"type": "text", "text": content.text})
# Skip empty text content blocks - Anthropic API rejects them
if content.text:
a_content.append({"type": "text", "text": content.text})
case "data":
if content.has_top_level_media_type("image"):
a_content.append({