Build a default message for structured agent tool input.
(options: StructuredToolInputBuilderOptions)
| 48 | |
| 49 | |
| 50 | def 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 | |
| 79 | async def resolve_agent_tool_input( |