Create the AskUserQuestion tool
Arguments
- ask_question_fn
Function or NULL. If provided, called with
(question, choices)instead ofreadline(). Used by the Shiny UI to show an input bar and await the user's answer.- async
Logical. When
TRUE, the toolfunis acoro::asyncfunction thatawait()s a promise returned byask_question_fn(Shiny path). Requires the chat to be run viastream_async()/chat_async(). LeaveFALSEfor the synchronous CLI path (an async fun always returns a promise, which the sync tool loop would not await).
Value
An ellmer::ToolDef.