Custom Prompt Templates
Last updated
Last updated
Bito Inc. (c) 2024
🤯 Sick of typing out long prompts every time? 😩 Bito's got your back! Now, create custom prompt templates for all your frequently used prompts and save yourself some stress.
With "Create Prompt Template," you can create and save custom prompt templates for use in your IDE. By defining a custom template with a template name and prompt, Bito can execute the prompt as is on the selected code. With this feature, you can save time and streamline your workflow by quickly executing frequently used prompts without inputting them manually each time.
The custom prompt templates feature and standard prompt templates are located below the chatbox.
Here is a quick overview of the Custom Prompt Templates in Bito
Open Bito Plugin in your IDE
Below the chatbox, click on "New Template".
Enter the "Template Name" and "Prompt" for your custom template. You can use {{%code%}} as a macro to insert the selected code in your prompt. If this macro is not used, Bito will insert the selected code at the end of your prompt. Next, select the "Output Format". You currently have two options:
Display in Bito panel (Default)
Output in diff view
Click on "Create Template" to save your new custom template. All custom templates will appear below the chatbox alongside standard templates. You can create up to four custom templates.
Tips: Creating a good AI prompt is an iterative process. We recommend you iterate various options and check the output to ensure your satisfaction. Here are some helpful hints:
Add instruction in the template to enclose any code output in triple backticks (```). This will ensure that the code is formatted in a code block in the output.
Write clear and specific instructions. If you want output in a specific format, ask to structure the output in that format.
Specify the steps to complete the task. A clearly defined set of steps allows the model to think and work out a solution before generating the output.
Custom templates require selecting code in IDE. Bito replaces all instances of the {{%code%}} in the template with the selected code. If no {{%code%}} macro is found, the selected code is appended to the end of the code.
Your task is to analyze the code given below: {{%code%}}. The code needs to be analyzed for the top 10 security vulnerabilities defined by OWASP. If no vulnerability is found, the output should be "No Issue Found". If any issue is found, identify all instances of the code. The output should include a list of all issues and the fixed code in the following format. The code should be enclosed in the three backticks.
Issues: List of Issues
Code: Fixed code enclosed in three back ticks
You can edit or remove the templates anytime by clicking on the three dots over the template that you want to edit or remove. Note that you can edit or remove the standard templates provided by Bito.
Select any code that you want to execute the prompt.
Run the Custom Template by clicking it in the Bito Templates panel or from the IDE context menu.
Bito starts generating output
Here’s an example of how to execute prompts using your custom templates.
Let’s say you want to create a custom template to add a comment describing the logic behind the code. Here's how you can do it:
Below the chatbox, click on "New template".
Enter a name for your custom template, e.g. "Add Comment"
In the "Prompt" field, enter the following: "Please add a comment describing the logic behind the code. " and then click on "Create Template" to save your new custom template
Now, select the code to which you want to comment and click on the "Add Comment" template.
Bito adds the selected code at the end of the prompt and executes it via Bito AI.