Elicit#
Gives the assistant the ability to request structured input from the user.
Elicitation supports multiple input types:
text: Free-form text inputchoice: Single selection from optionsmulti_choice: Multiple selections from optionssecret: Hidden input (API keys, passwords) with UI redactionconfirmation: Yes/No questionform: Multiple fields collected at once
Secret values are handled specially: the value is hidden from the chat display
(hide=True) so it does not appear on screen, but it is passed to the LLM
in-context so the agent can act on it (e.g. set it as an env var). The value
is stored in the on-disk conversation log.
Instructions
### When to use elicit
Use elicit when you need structured user input that a plain text reply cannot
cleanly provide:
- **secret** — API keys, passwords, tokens. The value is hidden from the chat
display so it does not appear over someone's shoulder; the LLM still receives
it in-context so it can act on it (e.g. export as an env var or pass to a
command). The conversation log on disk will contain the value.
- **choice / multi_choice** — present a fixed set of options so the user
selects rather than types a free-form answer that you then have to parse.
- **confirmation** — ask yes/no before a destructive or irreversible action.
- **form** — collect several related fields in one interaction instead of a
back-and-forth sequence.
Do **not** use elicit for simple open-ended questions that read naturally in
chat — a plain assistant message is clearer and less disruptive in those cases.
### Input types
- text: Free-form text input
- choice: Single selection from a list (specify options)
- multi_choice: Multiple selections from a list (specify options)
- secret: Hidden from display; LLM receives the value in-context to act on it
- confirmation: Yes/No question
- form: Multiple fields at once (specify JSON field definitions)
Examples
Ask for a secret API key
| User |
Set up the OpenAI integration |
| Assistant |
I need your OpenAI API key to proceed. It will be hidden from normal chat display. |
| System |
User provided secret value (not shown) |
Ask user to choose an option
| User |
Which database should we use? |
| Assistant |
Let me ask the user their preference. |
| System |
User selected: PostgreSQL |
Collect project setup information via form
| User |
Set up a new project |
| Assistant |
Let me gather some details about the project. |
| System |
Form submitted: {"name": "my-project", "language": "python", "tests": true}
|