MCPcopy Index your code
hub / github.com/openai/openai-agents-python / _normalize_tool_input

Method _normalize_tool_input

src/agents/agent.py:590–597  ·  view source on GitHub ↗
(parsed: Any, tool_name: str)

Source from the content-addressed store, hash-verified

588 )
589
590 def _normalize_tool_input(parsed: Any, tool_name: str) -> Any:
591 # Prefer JSON mode so structured params (datetime/UUID/Decimal, etc.) serialize cleanly.
592 try:
593 return params_adapter.dump_python(parsed, mode="json")
594 except Exception as exc:
595 raise ModelBehaviorError(
596 f"Failed to serialize structured tool input for {tool_name}: {exc}"
597 ) from exc
598
599 async def _run_agent_impl(context: ToolContext, input_json: str) -> Any:
600 from .run import DEFAULT_MAX_TURNS, Runner

Callers

nothing calls this directly

Calls 1

ModelBehaviorErrorClass · 0.85

Tested by

no test coverage detected