Skip to main content

AI Prompt

Version: v1 (current)

The AI Prompt task presents participants with an interactive chat interface powered by a large language model (LLM). Researchers configure the AI's behavior, and all messages are recorded for analysis.

Overview

This task enables conversational data collection where participants interact with a configured AI assistant. The researcher defines:

  • A system prompt that controls the AI's persona, tone, and behavior (invisible to participants)
  • Optional RAG documents to give the AI specialized knowledge
  • Safety filters and cost guardrails (turn limits, token budgets)

The complete conversation transcript (every participant message and AI response) is saved as task data, along with metadata such as response latency and token usage.

How It Works

1. Main Instructions

Before the chat begins, participants see your main instructions page explaining what they should do.

2. Conversation

Participants type messages and receive AI responses in a two-column chat interface:

  • Left panel: the conversation area where messages appear in a scrolling chat window with participant and AI avatars, an optional typing indicator, and optional timestamps, turn counter, and Markdown rendering
  • Right panel: a persistent instructions panel showing researcher-configured guidance, with the Finish button at the bottom

3. Completion

Participants click the Finish button in the right-hand panel when done. The full transcript is saved automatically.

Configuration Options

Provider & Model Settings

OptionDescriptionDefault
AI ProviderWhich AI provider to useGoogle Gemini
ModelModel to use (options change based on provider)gemini-2.5-flash
TemperatureControls randomness (0 = deterministic, 2 = very creative)0.7
Max TokensMaximum tokens per AI response1024
Top-PNucleus sampling parameter (Gemini, OpenAI, Anthropic)0.95
Top-KTop-k sampling parameter (Gemini, Anthropic only)40
Frequency PenaltyPenalizes repeated tokens (OpenAI only, -2.0 to 2.0)0
Presence PenaltyPenalizes tokens that have appeared (OpenAI only, -2.0 to 2.0)0

Available providers and models:

Google Gemini (default):

  • gemini-3-pro-preview — Most capable preview model
  • gemini-3-flash-preview — Fast preview model
  • gemini-2.5-pro — Stable, most capable
  • gemini-2.5-flash — Stable, fast, general-purpose (recommended)

OpenAI:

  • gpt-4.1 — Most capable
  • gpt-4.1-mini — Fast, cost-effective
  • gpt-4.1-nano — Fastest, most affordable
  • gpt-4o — Multimodal
  • gpt-4o-mini — Fast multimodal

Anthropic:

  • claude-sonnet-4-5-20250929 — Claude Sonnet 4.5
  • claude-haiku-4-5-20251001 — Claude Haiku 4.5

The configuration panel adapts based on the selected provider — parameters that are not supported by a provider are automatically hidden.

note

Only Google Gemini is currently active in the backend. OpenAI and Anthropic support is planned for a future update.

Cost & Length Controls

OptionDescriptionDefault
Max TurnsMaximum number of exchanges (0 = unlimited)0
Total Token BudgetOverall cap on tokens for the conversation (0 = unlimited)0
Max Message LengthCharacter limit for participant messages2000
Context OverflowStrategy when conversation exceeds context windowSummarize

Context overflow strategies:

  • Summarize — Older turns are summarized to fit the context window (recommended)
  • Truncate — Oldest turns are dropped
  • None — Let the API handle truncation

Chat UI Options

OptionDescriptionDefault
Initial AI MessageOptional greeting shown at the start(empty)
Show Typing IndicatorAnimated dots while AI generates a responseEnabled
Enable MarkdownRender AI responses with Markdown formattingEnabled
Show TimestampsDisplay time next to each messageDisabled
Show Turn CounterDisplay "Turn X / Y" indicatorDisabled

System Prompt

The system prompt defines the AI's behavior. Participants never see it. Use it to:

  • Set a persona ("You are a helpful tutor specializing in mathematics")
  • Define conversation rules ("Always ask one follow-up question")
  • Restrict topics ("Only discuss the provided documents")
  • Control response style ("Keep answers under 3 sentences")

Safety Filters (Gemini only)

Gemini's built-in safety filters can be configured per category. This section is only visible when Google Gemini is selected as the provider.

CategoryOptions
HarassmentBlock none / Block only high / Block medium and above / Block low and above
Hate speechBlock none / Block only high / Block medium and above / Block low and above
Sexually explicitBlock none / Block only high / Block medium and above / Block low and above
Dangerous contentBlock none / Block only high / Block medium and above / Block low and above

Default is Block medium and above for all categories.

Instructions

Use the rich text editors to customize:

  • Main Instructions: Explain the task before the chat begins (shown as a full-page pre-task screen)
  • Hint Instructions: Quick reference available via the "?" button during the task
  • Panel Instructions: Persistent instructions displayed in the right-hand panel throughout the conversation. Use this to remind participants of the task goal, what to discuss with the AI, and when to click Finish

Advanced Context Settings

These settings control the scaffolding text injected into the AI model's context. Customizing them prevents language bias when conducting studies in non-English languages.

SettingDescriptionDefault (EN)Default (FR)
RAG Context PrefixText prepended to RAG documents in the system instruction"Reference documents (use these to inform your responses):""Documents de référence (utilisez-les pour éclairer vos réponses) :"
Summarization PromptInstruction sent when older conversation turns need summarizing"Summarize the following conversation concisely, preserving key topics, decisions, and context:""Résumez la conversation suivante de manière concise, en préservant les sujets clés, les décisions et le contexte :"
Summary LabelLabel prepended to the generated summary"[Summary of earlier conversation]:""[Résumé de la conversation précédente] :"

When the study's primary language is not English, update these strings to match the study language. This ensures all AI context is in the same language as the participant interaction.

Use Cases

Conversational Assessment

Evaluate comprehension through dialogue:

System prompt: "You are an interviewer assessing the participant's
understanding of climate change. Ask open-ended questions and
follow up on their responses. Cover causes, effects, and solutions."

Interactive Tutoring Research

Study learning through AI-guided instruction:

System prompt: "You are a Socratic tutor for introductory physics.
Never give direct answers. Instead, guide the student with questions
that help them discover the answer themselves."

Language Production Studies

Collect naturalistic language samples:

System prompt: "You are a friendly conversation partner. Discuss
everyday topics. Ask follow-up questions to keep the conversation
going. Match the participant's language complexity level."

Human-AI Interaction Studies

Research how people interact with AI systems:

System prompt: "You are a customer service agent for a fictional
airline. Help the participant rebook a cancelled flight. You have
limited options available."

Data Collected

Each conversation produces the following data:

FieldDescription
turn_numberSequential turn number
participant_messageWhat the participant typed
ai_responseThe AI's response text
api_latency_msTime taken for the API to respond
tokens_usedTokens consumed in this exchange
finish_reasonWhy the response ended (STOP, MAX_TOKENS, SAFETY, etc.)

Events logged:

  • chat_started — Chat session began
  • message_sent — Participant sent a message
  • response — AI response received
  • chat_finished — Participant clicked Finish

Setup Requirements

This task requires a Gemini API key configured as a Firebase secret:

firebase functions:secrets:set GEMINI_API_KEY

Enter your Google AI Studio API key when prompted. The key is stored securely and only accessible by the Cloud Functions at runtime.

Participant-Facing Labels

The following labels can be customized per language in the task's meta-translations:

LabelDefault (EN)Description
SendSendSend button text
FinishFinishFinish button text
PlaceholderType your message...Input placeholder text
TypingAI is typing...Typing indicator text
ErrorAn error occurred...Error message text
Budget exhaustedConversation limit reachedShown when token/turn budget is exceeded