ask_user — ask the user a clarifying question
ask_user hands control back to the user via a configured callback. Use it when the agent genuinely needs a decision — a destination directory, a yes/no on a risky action, a choice between equivalent approaches — and not for filler check-ins.
Schema
Section titled “Schema”| Arg | Type | Required | Description |
|---|---|---|---|
question | string | yes | The question to ask. |
choices | array[string] | no | Optional choices to render as a pick-list. |
Wiring the callback
Section titled “Wiring the callback”from chimera.tools.ask_user import AskUserTool
def cli_prompt(question: str, choices: list[str] | None) -> str: print(question) if choices: for i, c in enumerate(choices, 1): print(f" {i}) {c}") return input("> ").strip()
tool = AskUserTool(callback=cli_prompt)Without a callback, the tool raises an error — the protocol is “configure or don’t enable”.
Example invocation
Section titled “Example invocation”{ "question": "Run the migration against production?", "choices": ["yes", "no", "dry-run first"]}Output sample
Section titled “Output sample”dry-run first(The raw user response, as a string.)
- Pair with the Wire channel for GUI front-ends — the wire’s
UserQuestion/UserAnswermessages map onto this tool. - For permission-style prompts (“approve this bash command?”), use the
Permissionslayer instead — it integrates with auditing.