Legion. Tools. HumanTool
(Legion v0.4.0)
View Source
Built-in tool for asking a human a question mid-execution.
Configuration
Configure via tool_config/1 in your agent:
def tool_config(Legion.Tools.HumanTool) do
[handler: MyApp.ChatHandler, timeout: 30_000]
endOptions:
:handler(required) — a pid or registered name that receives{:human_request, ref, from_pid, question, meta}and must send{:human_response, ref, answer}back tofrom_pid.:timeout— milliseconds to wait for a response. Defaults to:infinity.
Usage (for LLM agent)
Legion.Tools.HumanTool.ask("What format do you prefer?")
Summary
Functions
Asks a human a question and blocks until they respond.
Callback implementation for Legion.Tool.description/0.
Callback implementation for Legion.Tool.extra_allowed_modules/0.
Functions
Asks a human a question and blocks until they respond.
Returns the human's answer as a string.
Use this tool with eval_and_continue.
Callback implementation for Legion.Tool.description/0.
Callback implementation for Legion.Tool.extra_allowed_modules/0.