refactor: refactor TesterPanel into smaller components

This commit is contained in:
Abhishek Kumar 2026-05-21 13:48:40 +05:30
parent 5d9ae9da6d
commit f1fdc41949
38 changed files with 2062 additions and 1492 deletions

View file

@ -64,13 +64,17 @@ def build_function_call_start_event(
*,
function_name: str | None,
tool_call_id: str | None,
arguments: dict[str, Any] | None = None,
) -> dict[str, Any]:
payload: dict[str, Any] = {
"function_name": function_name,
"tool_call_id": tool_call_id,
}
if arguments is not None:
payload["arguments"] = arguments
return {
"type": RealtimeFeedbackType.FUNCTION_CALL_START.value,
"payload": {
"function_name": function_name,
"tool_call_id": tool_call_id,
},
"payload": payload,
}

View file

@ -276,6 +276,7 @@ class RealtimeFeedbackObserver(BaseObserver):
build_function_call_start_event(
function_name=frame.function_name,
tool_call_id=frame.tool_call_id,
arguments=dict(frame.arguments or {}),
)
)
# Handle function call result

View file

@ -80,6 +80,7 @@ def build_text_chat_realtime_feedback_events(
build_function_call_start_event(
function_name=payload.get("function_name"),
tool_call_id=payload.get("tool_call_id"),
arguments=payload.get("arguments"),
),
timestamp=timestamp,
turn=turn_index,