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
| Option | Description | Default |
|---|---|---|
| AI Provider | Which AI provider to use | Google Gemini |
| Model | Model to use (options change based on provider) | gemini-2.5-flash |
| Temperature | Controls randomness (0 = deterministic, 2 = very creative) | 0.7 |
| Max Tokens | Maximum tokens per AI response | 1024 |
| Top-P | Nucleus sampling parameter (Gemini, OpenAI, Anthropic) | 0.95 |
| Top-K | Top-k sampling parameter (Gemini, Anthropic only) | 40 |
| Frequency Penalty | Penalizes repeated tokens (OpenAI only, -2.0 to 2.0) | 0 |
| Presence Penalty | Penalizes 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 modelgemini-3-flash-preview— Fast preview modelgemini-2.5-pro— Stable, most capablegemini-2.5-flash— Stable, fast, general-purpose (recommended)
OpenAI:
gpt-4.1— Most capablegpt-4.1-mini— Fast, cost-effectivegpt-4.1-nano— Fastest, most affordablegpt-4o— Multimodalgpt-4o-mini— Fast multimodal
Anthropic:
claude-sonnet-4-5-20250929— Claude Sonnet 4.5claude-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.
Only Google Gemini is currently active in the backend. OpenAI and Anthropic support is planned for a future update.
Cost & Length Controls
| Option | Description | Default |
|---|---|---|
| Max Turns | Maximum number of exchanges (0 = unlimited) | 0 |
| Total Token Budget | Overall cap on tokens for the conversation (0 = unlimited) | 0 |
| Max Message Length | Character limit for participant messages | 2000 |
| Context Overflow | Strategy when conversation exceeds context window | Summarize |
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
| Option | Description | Default |
|---|---|---|
| Initial AI Message | Optional greeting shown at the start | (empty) |
| Show Typing Indicator | Animated dots while AI generates a response | Enabled |
| Enable Markdown | Render AI responses with Markdown formatting | Enabled |
| Show Timestamps | Display time next to each message | Disabled |
| Show Turn Counter | Display "Turn X / Y" indicator | Disabled |
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.
| Category | Options |
|---|---|
| Harassment | Block none / Block only high / Block medium and above / Block low and above |
| Hate speech | Block none / Block only high / Block medium and above / Block low and above |
| Sexually explicit | Block none / Block only high / Block medium and above / Block low and above |
| Dangerous content | Block 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.
| Setting | Description | Default (EN) | Default (FR) |
|---|---|---|---|
| RAG Context Prefix | Text 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 Prompt | Instruction 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 Label | Label 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:
| Field | Description |
|---|---|
turn_number | Sequential turn number |
participant_message | What the participant typed |
ai_response | The AI's response text |
api_latency_ms | Time taken for the API to respond |
tokens_used | Tokens consumed in this exchange |
finish_reason | Why the response ended (STOP, MAX_TOKENS, SAFETY, etc.) |
Events logged:
chat_started— Chat session beganmessage_sent— Participant sent a messageresponse— AI response receivedchat_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:
| Label | Default (EN) | Description |
|---|---|---|
| Send | Send | Send button text |
| Finish | Finish | Finish button text |
| Placeholder | Type your message... | Input placeholder text |
| Typing | AI is typing... | Typing indicator text |
| Error | An error occurred... | Error message text |
| Budget exhausted | Conversation limit reached | Shown when token/turn budget is exceeded |