Lo-fi Chill 1
volume_up

How Do I Use This

An interactive guide to prompt Engineering for Gemini

foundation

Prompting Foundations: The PTCF Framework

Learn More expand_more

This section introduces the PTCF framework, a strategic approach to ensure your instructions are clear, contextual, and get the results you want.

Understanding the PTCF Framework

The PTCF (Persona, Task, Context, Format) framework is a powerful mental model for constructing comprehensive and effective prompts. While not every component is mandatory for every prompt, consciously considering each can dramatically improve the quality and relevance of Gemini's responses.

P: Persona

Defining a persona tells Gemini who it should be. This influences its tone, style, vocabulary, and the knowledge base it prioritizes. For example, asking Gemini to respond as an "Expert Astrophysicist" will yield different language and depth than asking it to respond as a "Friendly Children's Science Teacher," even if the underlying topic is the same. A well-defined persona helps align Gemini's output with your expectations and the intended audience.

T: Task

This is the core action you want Gemini to perform. It should be clear, specific, and actionable. Use strong verbs like "Analyze," "Generate," "Summarize," "Compare," "Rewrite," or "Explain." A vague task leads to a vague response. For instance, instead of "Tell me about AI," a better task would be "Explain the concept of supervised machine learning in three paragraphs suitable for a business executive."

C: Context

Context provides the necessary background, constraints, and specific details Gemini needs to tailor its response. This can include the subject matter, target audience, specific data points, constraints (e.g., "using only information up to 2023"), or the overall goal of your request. The richer the context, the more nuanced and targeted Gemini's output will be. Lack of context often results in generic or overly broad answers.

F: Format

Specifying the format dictates how Gemini should structure its output. This ensures the information is presented in a way that is immediately usable for your needs. Examples include "Provide the answer as a bulleted list," "Generate a JSON object with keys 'name' and 'value'," "Write a formal email," or "Create a table with three columns." Without format guidance, Gemini will choose a default structure that may not be optimal.

The PTCF Framework Builder

Click "New Example Set" then P, T, C, F buttons above to build a prompt and enable generation.

Live examples are generated using Gemini 2.0 Flash to demonstrate prompt principles.

compare_arrows

Choose Your Model: Pro vs. Flash

Select a scenario to see which Gemini model might be a better fit, or explore the detailed comparison below.

Select a scenario above for a recommendation.

visibility

View Detailed Comparison

Details expand_more

Gemini 2.5 Pro: The Deep Thinker

Best for: Highly complex tasks requiring nuanced understanding, multi-step reasoning, and creative generation of novel solutions. If your task involves intricate problem-solving, detailed analysis of large amounts of information, or generating sophisticated, high-quality content (like in-depth technical papers or complex code for new algorithms), Pro is generally the preferred choice.

  • In-depth technical documentation drafting
  • Complex code generation and review (e.g., novel algorithms)
  • Detailed analytical reports and research synthesis
  • Creative writing requiring significant world-building or intricate plots
  • Tasks where accuracy and thoroughness are paramount over speed

Strengths: Superior reasoning depth, excellent for complex coding, excels at synthesizing information, often provides more thorough and well-explained outputs.

Considerations: May have slightly longer response times. Capabilities are still evolving as it's marked "experimental."

Gemini 2.5 Flash: The Swift Assistant

Best for: Everyday tasks, quick information retrieval, generating boilerplate code, summarizing text, and situations where rapid iteration and fast responses are prioritized. If you need quick answers, first drafts, or assistance with less complex coding or writing tasks, Flash offers a great balance of capability and speed.

  • Quick content summarization (articles, emails)
  • Drafting emails or social media posts
  • Generating boilerplate code or simple scripts
  • Everyday Q&A and information lookup
  • Initial brainstorming and idea generation
  • Tasks where speed and rapid iteration are key

Strengths: Optimized for speed and efficiency, handles a wide range of common tasks effectively, good for straightforward coding and debugging, provides quick turnarounds.

Considerations: May not delve as deeply into highly complex nuances as Pro. For tasks demanding utmost precision or exhaustive analysis, Pro might be more suitable. Also "experimental."

cases

Explore the Use Cases

auto_awesome

Advanced Prompting Techniques