Using Parameters in Prompts
Parameters are what make Cognipeer prompts truly powerful and flexible. This guide explains how to effectively use parameters in your prompts, including the different parameter types, formatting options, and advanced techniques.
Understanding Parameters
Parameters are dynamic placeholders in your prompts that get replaced with specific values when the prompt is used. They follow this syntax:
{{parameter_name:type}}
Where:
parameter_name
is a descriptive identifier for the parametertype
specifies the kind of input expected (text, number, checkbox, date)
When a user selects a prompt with parameters, Cognipeer automatically generates a form with fields for each parameter. After filling in the form, the parameter placeholders in the prompt are replaced with the user's input values.
Parameter Types
Cognipeer supports several parameter types, each designed for specific kinds of input:
Text Parameters
Syntax: {{parameter_name:text}}
Description: Accepts any text input, from single words to multiple paragraphs.
Use Cases:
- Names (products, people, companies)
- Descriptions
- Topics
- Instructions
Example:
Write a blog post about {{topic:text}} with a focus on {{audience:text}}.
Number Parameters
Syntax: {{parameter_name:number}}
Description: Accepts numeric values, including integers and decimals.
Use Cases:
- Quantities
- Percentages
- Monetary values
- Ratings
Example:
Generate a pricing strategy for a product with a manufacturing cost of ${{cost:number}} and a target profit margin of {{margin:number}}%.
Checkbox Parameters
Syntax: {{parameter_name:checkbox}}
Description: A boolean toggle that can be turned on or off.
Use Cases:
- Including/excluding optional content
- Enabling/disabling specific features
- Yes/no decisions
Example:
Analyze the market trends for {{industry:text}}.
{{include_competitors:checkbox}} Include analysis of top competitors.
{{include_forecast:checkbox}} Include 12-month forecast.
Date Parameters
Syntax: {{parameter_name:date}}
Description: Provides a date picker for selecting specific dates.
Use Cases:
- Time periods
- Deadlines
- Event dates
- Historical analysis
Example:
Provide a performance report for our marketing campaigns from {{start_date:date}} to {{end_date:date}}.
Parameter Naming Best Practices
Effective parameter names improve usability and clarity:
Be Descriptive
Use names that clearly indicate what the parameter represents:
- Good:
{{product_name:text}}
,{{target_audience:text}}
- Avoid:
{{param1:text}}
,{{input:text}}
Use Consistent Conventions
Establish naming patterns across your prompts:
- Use snake_case (e.g.,
{{product_name:text}}
) or camelCase (e.g.,{{productName:text}}
) - Be consistent with pluralization (e.g.,
{{num_days:number}}
vs.{{num_day:number}}
) - Use prefixes for related parameters (e.g.,
{{customer_name:text}}
,{{customer_id:text}}
)
Indicate Expected Format
When specific formats are required, include hints in the name:
{{email_address:text}}
{{phone_number:text}}
{{percentage_growth:number}}
Advanced Parameter Techniques
Default Values
While Cognipeer's parameter system doesn't directly support default values in the syntax, you can suggest defaults in your prompt text:
Write a social media post about {{topic:text}}.
Length: {{post_length:text}} (suggested: short, medium, or long)
Tone: {{tone:text}} (suggested: casual, professional, or enthusiastic)
Parameter Instructions
Include instructions about expected parameter values directly in your prompt:
Analyze sales data for {{product_line:text}} (enter the exact product line name as it appears in our catalog).
Compare performance across {{num_quarters:number}} quarters (enter a value between 1 and 8).
Conditional Content
Use checkbox parameters to include or exclude sections of your prompt:
Create a marketing email for our {{product_name:text}} product.
{{include_pricing:checkbox}} Include current pricing and any active promotions.
{{include_testimonials:checkbox}} Include customer testimonials and success stories.
{{include_cta:checkbox}} Include a strong call-to-action with urgency elements.
Nested Parameters
While not directly supported in the syntax, you can create the effect of nested parameters through careful prompt design:
Generate a report on {{main_topic:text}}.
{{include_subtopics:checkbox}} Include the following subtopics:
- {{subtopic_1:text}}
- {{subtopic_2:text}}
- {{subtopic_3:text}}
Parameter Usage Scenarios
Content Generation
Write a {{content_type:text}} about {{topic:text}} for {{audience:text}}.
The tone should be {{tone:text}} and the length approximately {{length:text}}.
{{include_cta:checkbox}} Include a call-to-action at the end.
{{include_statistics:checkbox}} Include relevant statistics and data points.
{{include_examples:checkbox}} Include practical examples or case studies.
Data Analysis
Analyze the {{data_type:text}} data for {{time_period:text}}.
Focus on the following metrics:
- {{metric_1:text}}
- {{metric_2:text}}
- {{metric_3:text}}
{{include_visualization:checkbox}} Suggest appropriate data visualizations.
{{include_recommendations:checkbox}} Provide actionable recommendations based on the analysis.
Customer Support
Create a response to a customer inquiry about {{issue_type:text}}.
Customer name: {{customer_name:text}}
Product purchased: {{product:text}}
Purchase date: {{purchase_date:date}}
{{is_urgent:checkbox}} This is an urgent issue requiring immediate attention.
{{has_previous_complaints:checkbox}} Customer has submitted previous complaints.
Research Queries
Conduct research on {{research_topic:text}} with a focus on developments between {{start_date:date}} and {{end_date:date}}.
Include information about:
{{include_key_players:checkbox}} Key players and organizations in this field
{{include_innovations:checkbox}} Major innovations and breakthroughs
{{include_market_impact:checkbox}} Market impact and commercial applications
{{include_future_trends:checkbox}} Predicted future trends
Testing and Refining Parameters
Preview Before Saving
Always use the preview function when creating parameterized prompts:
- Click Preview in the prompt editor
- Test the parameter form to ensure it works as expected
- Check how different parameter values affect the prompt
Iterative Refinement
Improve your parameters based on usage:
- Start with a basic version of your parameterized prompt
- Use it in real scenarios
- Note any confusion or limitations
- Refine parameter names, types, or instructions
- Test the updated version
User Feedback
Collect feedback on parameter usability:
- Ask colleagues to test your prompts
- Note any confusion about parameter names or expected values
- Identify parameters that could be split or combined
- Look for opportunities to add new parameters for greater flexibility
By effectively using parameters in your prompts, you can create flexible templates that adapt to different scenarios while maintaining consistency in structure and quality. Parameters transform static prompts into dynamic tools that can be customized for each use case, enhancing the value and versatility of your prompt library.