MCPcopy
hub / github.com/openai/openai-agents-python / default_tool_input_builder

Function default_tool_input_builder

src/agents/agent_tool_input.py:50–76  ·  view source on GitHub ↗

Build a default message for structured agent tool input.

(options: StructuredToolInputBuilderOptions)

Source from the content-addressed store, hash-verified

48
49
50def default_tool_input_builder(options: StructuredToolInputBuilderOptions) -> str:
51 """Build a default message for structured agent tool input."""
52 sections: list[str] = [STRUCTURED_INPUT_PREAMBLE]
53
54 sections.append("## Structured Input Data:")
55 sections.append("")
56 sections.append("```")
57 sections.append(json.dumps(options.get("params"), indent=2) or "null")
58 sections.append("```")
59 sections.append("")
60
61 json_schema = options.get("json_schema")
62 if json_schema is not None:
63 sections.append("## Input JSON Schema:")
64 sections.append("")
65 sections.append("```")
66 sections.append(json.dumps(json_schema, indent=2))
67 sections.append("```")
68 sections.append("")
69 else:
70 summary = options.get("summary")
71 if summary:
72 sections.append("## Input Schema Summary:")
73 sections.append(summary)
74 sections.append("")
75
76 return "\n".join(sections)
77
78
79async def resolve_agent_tool_input(

Callers

nothing calls this directly

Calls 2

appendMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected