Welcome to the world of Promptitude, where creating dynamic and reusable prompts is made easy with the use of input variables. If you're new to this concept, don't worry! This article will guide you through what input variables are, how they work, and how you can use them to enhance your prompt management experience.
What is an Input Variable?
An input variable is a changeable element within a prompt that allows you to customize and adapt the prompt based on the information you provide. Think of it as a blank space that you can fill with different data each time you use the prompt. This makes your prompts more flexible and powerful, eliminating the need for repetitive or redundant entries.
πΉ Types of Input Variables in Promptitude
Promptitude offers a variety of input variable types to cater to different needs:
Text Type: Simple text entries.
Selection Type: Choose from a list of options.
Website Type: Scrape data from websites.
Document Type: Upload documents in various formats.
Image Type: Upload an image.
Content Storage Type: Select context from your knowledge base, ideal for Retrieval-Augmented Generation (RAG) implementation.
β How Do Input Variables Work?
Using input variables in your prompts is straightforward. When crafting your prompt, you include the Name of the variable enclosed in double brackets, like this: {{input_name}}. This Name acts as an ID that identifies the input variable, allowing it to be replaced with the data you provide.
Unlimited Inputs: You can add as many input variables as you need.
Editable: You can edit, duplicate, or delete each input variable.
Customizable Order: Arrange them by dragging to your preferred position, which helps in visualizing the fields when using the prompt.
β Common Mistakes to Avoid
Uncreated Variables: Ensure that any variable you reference in your prompt is created in the inputs column.
Exact Naming: Use the exact name of the variable in your prompt to avoid recognition errors.
Required Fields: You cannot generate a prompt if a required input variable is missing.
Missing Required Fields: You cannot save your prompt if any variable input is missing a required field (label, name, or default value).
βοΈ Structure of an Input Variable
Every input variable in Promptitude has a basic structure, which includes:
Basic Fields (Required)
Label: The visual identification of the field.
Type: The type of the variable in Promptitude.
Name: The ID in square brackets that places the variable inside your prompt. (You can test it with the Preview Prompt function).
Default Value: A default value to replace variables in the prompt for easy testing.
Advanced Fields (Optional)
Description: Help text that explains how the field works or what to do with it.
Placeholder: Text inside the field that provides an example or guidance.
Display: Configure whether the field is required or optional, and its display style.
Keep in mind that when you leave an optional field empty, the structure of your prompt must still function correctly. During parsing, this variable will be empty, so ensure your prompt can accommodate this.
Content Limit: Set the maximum number of words allowed for the input, except for image type.
Content Limit: π Please remember that the input you provide is considered within the Input Context Window of the model you choose for generation. With the newer models, this context window has expanded significantly, ranging from 8,000 to 200,000 tokens. However, be aware that each input consumes tokens from this limit during parsing.
Additional Fields
Depending on the type of input, you may find extra fields that offer more flexibility and configurability. For more detailed information on each input type, refer to our other help articles.
Remember, the key to mastering input variables is practice and exploration, so don't hesitate to experiment with different types and configurations.
Happy prompting!