Files
retoorandClaude Sonnet 5.5 837de58136 feat(clients): google cloud voice: generic client, TTS, STT, Gemini audio, live voice page
src/google: GoogleClient over molo::clients (key in x-goog-api-key, never in
URLs), Service base, TextToSpeech, SpeechToText, Generative (replies, audio
in, audio out), Recognizer/Synthesizer seams with cloud, gemini and vertex
backends, VoicePipeline with bounded history. Example: /voice live
conversation page, /voice/{say,hear,turn,reset}, /google/status. Keys load
from env, .env.json.local, .env.json. Paid routes are excluded from locust.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 04:05:41 +02:00

26 lines
1.1 KiB
C++

// Route: GET /voice (live voice conversation page, script embedded)
#include "support/GoogleRig.hpp"
using namespace molo::example::test;
int main() {
GoogleRig rig;
Fixture f(rig.client);
auto page = f.client->get("/voice");
check(page.status == 200, "status 200");
check(contains(page.headers.get("Content-Type"), "text/html"), "html");
check(contains(page.body, "id=\"v-toggle\""), "start/stop button");
check(contains(page.body, "id=\"v-lang\""), "language select");
check(contains(page.body, "id=\"v-log\""), "conversation log");
check(contains(page.body, "/embedded/voice.js"), "script linked");
check(contains(page.body, "width=device-width"), "responsive viewport");
auto js = f.client->get("/embedded/voice.js");
check(js.status == 200 && contains(js.body, "/voice/turn"),
"page script served from the bundle");
check(contains(js.body, "getUserMedia") && contains(js.body, "MediaRecorder"),
"script records the microphone");
check(f.client->post("/voice").status == 405, "post is 405");
check(rig.mock->send_count() == 0, "side effect: page makes no Google call");
return finish("voice/page");
}