Skip to content

Commit 736b4a1

Browse files
committed
feat: Use PydanticJsonEncoder for JSON serialization in function calls. #2
1 parent a356eb6 commit 736b4a1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/adk_agui_middleware/utils/translate/function_calls.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
)
2222
from google.genai import types
2323

24+
from ...tools.json_encoder import PydanticJsonEncoder
25+
2426

2527
class FunctionCallEventUtil:
2628
"""Utility class for converting function calls to AGUI tool call events.
@@ -49,7 +51,7 @@ def create_function_result_event(
4951
message_id=str(uuid.uuid4()),
5052
type=EventType.TOOL_CALL_RESULT,
5153
tool_call_id=tool_call_id,
52-
content=json.dumps(content) if content else "",
54+
content=json.dumps(content, cls=PydanticJsonEncoder) if content else "",
5355
)
5456

5557
@staticmethod

0 commit comments

Comments
 (0)