Creating Parameterized Prompts
This tutorial covers creating prompts with multiple parameter types to build flexible, customizable templates.
Prerequisites
- A Cognipeer account with access to the Prompts feature
- Completion of the "Getting Started with Prompts" tutorial or equivalent experience
Tutorial Steps
Step 1: Plan Your Parameterized Prompt
Before creating a prompt with multiple parameters, it's helpful to plan:
- Identify the purpose of your prompt (e.g., generating a marketing email)
- Determine which elements should be customizable (e.g., product name, target audience, key features)
- Choose the appropriate parameter type for each element:
- Text: For names, descriptions, and other text content
- Number: For quantities, percentages, or other numeric values
- Checkbox: For optional sections or boolean choices
- Date: For time-specific information
For this tutorial, we'll create a prompt for generating a product marketing email.
Step 2: Create a New Prompt
- Navigate to the Prompts section in the sidebar
- Click the Create Prompt button
- Enter the following details:
- Title: "Marketing Email Generator"
- Description: "Creates a marketing email for a product with customizable elements"
- Tags: "marketing, email, product" (optional)
Step 3: Write the Prompt Text with Parameters
- In the Prompt Text field, enter the following:
Create a marketing email for our product: { {product_name:text} }
Target audience: { {target_audience:text} }
Email purpose: { {purpose:text} } (e.g., product launch, feature announcement, promotion)
Key points to highlight:
- { {key_point_1:text} }
- { {key_point_2:text} }
- { {key_point_3:text} }
Price: ${ {price:number} }
{ {include_limited_time_offer:checkbox} } Include a limited-time offer that expires on { {expiration_date:date} }
{ {include_testimonials:checkbox} } Include customer testimonials
Email tone should be { {tone:text} } (e.g., professional, casual, enthusiastic)
Format the email with a compelling subject line, greeting, body with bullet points for features, and a strong call-to-action.- This prompt includes multiple parameter types:
- Text parameters: product_name, target_audience, purpose, key points, tone
- Number parameter: price
- Checkbox parameters: include_limited_time_offer, include_testimonials
- Date parameter: expiration_date
Step 4: Preview Your Prompt
- Click the Preview button to see how your prompt will appear to users
- The preview will show the parameter form that will be generated when someone uses this prompt
- Test filling in the parameters to ensure they work as expected
- Make any necessary adjustments to the prompt text or parameters
Step 5: Save Your Prompt
- Set the appropriate Visibility Settings (Private, Shared, or Public)
- Click Save to create your prompt
- Your new parameterized prompt will now appear in your prompts library
Step 6: Test Your Prompt
- From the prompt details page, click Use
- Fill in the parameter form with sample values:
- Product Name: "EcoBoost Smart Thermostat"
- Target Audience: "Environmentally conscious homeowners"
- Purpose: "Product launch"
- Key Points: "Saves up to 30% on energy bills", "AI-powered temperature optimization", "Easy smartphone control"
- Price: 199.99
- Toggle on "Include a limited-time offer" and select a date
- Toggle on "Include testimonials"
- Tone: "Enthusiastic"
- Select a Peer to send the prompt to
- Click Send to generate the marketing email
Step 7: Evaluate and Refine
- Review the generated email from the Peer
- Assess whether the parameters worked as expected
- Note any improvements you could make to the prompt structure
- If needed, go back to edit your prompt by clicking the Edit button on the prompt details page
Expected Outcome
By the end of this tutorial, you will have:
- Created a prompt with multiple parameter types
- Tested how different parameter values affect the output
- Generated a customized marketing email using your parameterized prompt
Next Steps
To further enhance your skills with parameterized prompts:
- Create prompts with conditional sections that depend on checkbox parameters
- Develop prompts for other common tasks in your workflow
- Share your parameterized prompts with colleagues to standardize team outputs
- Explore more complex parameter combinations for specialized use cases
Troubleshooting
Problem: Date parameter doesn't display a date picker. Solution: Ensure you've used the correct syntax \{\{parameter_name:date\}\} and that your browser supports date input fields.
Problem: Checkbox parameters don't affect the output as expected. Solution: Make sure your prompt text clearly indicates what content should be included when the checkbox is selected.
Problem: Too many parameters make the form unwieldy. Solution: Consider breaking complex prompts into multiple simpler prompts, or group related parameters together with clear section headings.

