Custom Inputs
This feature is essential for customizing the execution process to meet your specific needs and making decisions based on real-time feedback from the command. These inputs have slugs that can be used as Jinja variables when creating the Quick Command, which works like the QC creation steps.
After registering an Input (1), you can use it through the Jinja variable defined in the slug of the input. For prompts, a facilitator button (2) will automatically appear to simplify its usage. If the input type is a Web Request, the slug can be used in any part, such as the URL, the request body, or the header, even if the facilitator button is unavailable.
The main advantage of the Custom Input is that it allows you to request multiple parameters without relying solely on IDE selection. Additionally, you can configure whether the parameter input will be mandatory or optional, providing greater flexibility in its usage.
Add inputs
When creating your Quick Command, click on the 'Add input' box and fill out the following:
- User question: Specify the question that the user needs to answer.
Example: What is the token of the service?
- Slug: It should differ from any previous slug commands.
IDE: You can use this slug in the prompt or web request creation.
Example: token-question
- This input is mandatory: This option requires the user to provide a response for the Quick Command to be executed.
The user can skip the question if you don't mark this option.
Example on creating your Quick Command with a custom input
This Quick Command provides Wikipedia results, but it only works on the IDE extension.
See more details below:
- Create your 'Quick Command'.
Click on the 'Add input' box;
-
Add the user question: Add the keyword to search on Wikipedia.
-
slug-identification: wiki-search
- On your Web Request Quick Command, add a:
- Web request name: wikipedia
- HTTP Method: POST
- URL Endpoint:
https://en.wikipedia.org/w/api.php?action=query&format=json&list=search&srsearch={{wiki-search}}
- Request Body:
{
"action": "query",
"format": "json",
"list": "search",
“research”: “{{wiki-search}}”
}
- In the Quick Command Utilization, add the final result as below to show only the first result:
{{wikipedia.json["query"]["search"][0]["snippet”]}}
- Using on the IDE
You can only use the QC in the IDE. See the example below:
Usage
To use the custom inputs feature, you must provide specific information at the beginning of a Quick Command execution.
IDE
When you are executing a Quick Command in the IDE, and it has custom inputs, it will ask some questions.
You must provide some information to execute the Quick Command ´QC-name´. Some may be mandatory, and others optional. Let's get started.
If it is mandatory, you must answer them. If not, press the skip button.