36 lines
1005 B
Python
36 lines
1005 B
Python
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
|
|
def tool_response(
|
|
*,
|
|
status: str,
|
|
case_id: str | None = None,
|
|
message: str = "",
|
|
data: dict[str, Any] | None = None,
|
|
human_options: list[str] | None = None,
|
|
checkpoint: str | None = None,
|
|
next_required_action: str | None = None,
|
|
forbidden_next_tools: list[str] | None = None,
|
|
stop_agent_turn: bool = False,
|
|
) -> dict[str, Any]:
|
|
payload: dict[str, Any] = {
|
|
"status": status,
|
|
"message": message,
|
|
"data": data or {},
|
|
}
|
|
if case_id:
|
|
payload["case_id"] = case_id
|
|
if human_options:
|
|
payload["human_options"] = human_options
|
|
if checkpoint:
|
|
payload["checkpoint"] = checkpoint
|
|
if next_required_action:
|
|
payload["next_required_action"] = next_required_action
|
|
if forbidden_next_tools:
|
|
payload["forbidden_next_tools"] = forbidden_next_tools
|
|
if stop_agent_turn:
|
|
payload["stop_agent_turn"] = True
|
|
return payload
|