一键导入
gemini-ai
Gemini API integration for generating pedagogically-grounded game questions from lesson content
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Gemini API integration for generating pedagogically-grounded game questions from lesson content
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
File upload, parsing (PDF, PPTX, DOCX, ODT, HTML, MD), and Convex storage for lesson materials
Convex database schema, queries, mutations, actions, and real-time subscriptions for LessonPlay
Game state machine, lobby system, question flow, scoring, and real-time game coordination
shadcn/ui patterns, game UI components, responsive layouts for classroom use
| name | gemini-ai |
| description | Gemini API integration for generating pedagogically-grounded game questions from lesson content |
Handles the two-step AI generation pipeline — the core differentiator of LessonPlay. Gemini processes lesson content + learning objectives to produce (1) structured questions and (2) a self-contained HTML game that runs in a sandboxed iframe.
@google/genai npm package (GoogleGenAI class)import { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI({ apiKey });
const response = await ai.models.generateContent({ model, contents, config });
const text = response.text; // property, NOT a method
Use config.responseMimeType: "application/json" and config.responseSchema to enforce JSON structure. The SDK handles schema validation — no need to manually parse or hope for correct formatting.
| Objective Type | Preferred Question Types |
|---|---|
| Understand | Multiple choice (concept questions) |
| Explain | Multiple choice (why/how questions) |
| Apply | Multiple choice (scenario-based) |
| Distinguish | Categorization (sort into groups) |
| Perform | Ordering (sequence steps) |
| Analyze | Multiple choice + categorization |
Gemini calls MUST happen in a Convex action (not query or mutation). Use ctx.runMutation(internal.xxx.yyy, args) to store results in the database.
The generated HTML must:
<!DOCTYPE html> document with inline <style> and <script><meta name="viewport" content="width=device-width, initial-scale=1.0">Before storing, validate:
postMessage or port.postMessage codesrc= or href= pointing to other domainsconvex/generate.ts — Gemini API action (two-step: questions + HTML game)docs/PRD.md — Architecture and AI generation sections