Skip to content

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:

  1. Identify the purpose of your prompt (e.g., generating a marketing email)
  2. Determine which elements should be customizable (e.g., product name, target audience, key features)
  3. 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

  1. Navigate to the Prompts section in the sidebar
  2. Click the Create Prompt button
  3. 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

  1. 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.
  1. 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

  1. Click the Preview button to see how your prompt will appear to users
  2. The preview will show the parameter form that will be generated when someone uses this prompt
  3. Test filling in the parameters to ensure they work as expected
  4. Make any necessary adjustments to the prompt text or parameters

Step 5: Save Your Prompt

  1. Set the appropriate Visibility Settings (Private, Shared, or Public)
  2. Click Save to create your prompt
  3. Your new parameterized prompt will now appear in your prompts library

Step 6: Test Your Prompt

  1. From the prompt details page, click Use
  2. 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"
  3. Select a Peer to send the prompt to
  4. Click Send to generate the marketing email

Step 7: Evaluate and Refine

  1. Review the generated email from the Peer
  2. Assess whether the parameters worked as expected
  3. Note any improvements you could make to the prompt structure
  4. 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.

Studio · Pulse — Cognipeer product documentation