--- title: ASQ Rokid Gateway emoji: 🥽 colorFrom: green colorTo: gray sdk: gradio sdk_version: 5.49.1 app_file: app.py pinned: false --- # ASQ Rokid Gateway Secure gateway and mobile interview-preparation page for the private English ASQ Space. ## Flow 1. A researcher opens the Space root on a phone and enters the permanent six-digit access code. 2. The researcher enters the case/interview background and starts preparation. 3. The gateway wakes the private ASQ Space, generates initial hypotheses, and returns a temporary six-digit interview code. 4. The Rokid application joins with that interview code, confirms readiness, records a child utterance on demand, and displays the next suggested question. The phone and glasses use different tokens. The permanent researcher code is never placed in the glasses package, and each interview code expires with its server session. ## Required secrets - `ACCESS_CODE`: permanent researcher code, exactly six digits. - `SESSION_SECRET`: long random signing secret. - `HF_TOKEN`: read token scoped to the private target Space. ## Optional variables - `TARGET_SPACE_ID`: defaults to `ASQ2/ASQ`. - `TARGET_INITIALIZE_API_NAME`: defaults to `/initialize_flow`. - `TARGET_CHAT_API_NAME`: defaults to `/chat_flow`. - `SESSION_TTL_SECONDS`: defaults to 14,400 seconds. - `MAX_BACKGROUND_CHARS`: defaults to 20,000 characters. - `PREPARE_TIMEOUT_SECONDS`: maximum cold-start retry window, defaults to 600 seconds. - `PREPARE_RETRY_SECONDS`: delay between cold-start attempts, defaults to 15 seconds. ## Endpoints - `GET /`: responsive phone preparation page. - `GET /health`: configuration status. - `POST /auth`: researcher login. - `POST /prepare`: begin model wake-up and hypothesis generation. - `POST /join`: exchange a temporary interview code for a glasses token. - `GET /session`: poll preparation status. - `POST /start`: glasses readiness check. - `POST /suggest`: submit one transcript and return the next question. Active interview state is currently held in memory. This is appropriate for the prototype, but a production deployment should move sessions to a persistent shared store before enabling multiple workers or unattended long-running studies. No Hugging Face token or permanent access code is embedded in the Rokid application or committed to this repository.