GCP speech result subcommand | Generated by AI
All changes are in place. Here’s a summary of what was done:
Changes made:
ww/gcp_speech/result.py(new file) — theww gcp-speech result <job-id>command:- Looks up the job ID in
~/.ww_gcp_jobs.json(the local jobs registry) - Checks GCS for completed transcription JSON files
- If results exist: downloads them, prints the transcript, and saves a
.mdfile alongside the original audio - If not yet complete: prints the console URL and suggests
--waitto poll - Supports
--waitflag for blocking mode (polls every 10s)
- Looks up the job ID in
ww/gcp_speech/transcribe.py— modified to:- Print a clear
Job ID:line in the output (the basename/filename-stem) - Save job info to
~/.ww_gcp_jobs.json(operation name, GCS folder, audio file, language) - Direct users to
ww gcp-speech result <job-id> --waitinstead ofgsutil cp
- Print a clear
-
ww/main.py— addedresultsubcommand routing and help text ~/.zsh/completions/_ww— addedresulttogcp_speech_cmdsfor tab completion
Usage flow:
ww gcp-speech transcribe ~/Downloads/recording.mp3
→ Prints: Job ID: recording
→ Saves job to ~/.ww_gcp_jobs.json
ww gcp-speech result recording
→ Checks GCS for results, prints transcript if ready
ww gcp-speech result recording --wait
→ Polls until complete, then prints transcript
