بنقرة واحدة
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 ويثبّتها لك.
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
استنادا إلى تصنيف SOC المهني
| 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