feat(local-session): HTTP API to start, upload to and stop a local session - #10
Open
Rahulkaushik01 wants to merge 1 commit into
Open
Conversation
…ssion The desktop is deliberately dumb: it captures audio and uploads it, and the server does all the segmentation and transcription. * start creates the Bot, Recording and the mic/system participants. Speaker labels are optional -- a single-mic in-person recording has nothing to distinguish, so it sends no name and gets no label, while an online meeting labels the mic "You" and the system track "Others". * audio accepts short PCM segments tagged with a monotonic sequence and an offset_ms measured from the start of the session. Uploads are queued and drained off-request so the desktop never waits on transcription. * stop finalizes the session; transcript reuses the bot transcript view. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The HTTP surface the desktop talks to: start a session, upload audio chunks, stop, and read
the transcript.
Problem
The desktop must stay dumb — capture and upload only. If it performed segmentation or
transcription locally we would have to ship and maintain that logic across Windows, macOS and
Linux, and hold STT credentials on the client. All intelligence belongs server-side, reusing
the pipeline meeting bots already use.
How it works
Bot,Recordingand the mic/system participants, and configures anaudio-only MP3 recording transcribed by ElevenLabs with an optional
language_code.Speaker labels are optional: a single-mic in-person recording has nothing to distinguish,
so it sends no name and gets no label; an online meeting labels the mic
"You"and the systemtrack
"Others", which yields "me vs them" attribution for free — no diarization service needed.source, a monotonicsequenceandoffset_ms. It validates strictly — source, sample rate, non-negative integers, even bytelength, and a size cap — because a malformed upload would otherwise raise deep inside the VAD.
Chunks are queued and drained off-request, so the desktop never blocks on transcription.
Changes made
bots/local_session_api_views.pybots/local_session_api_urls.pyattendee/urls.pyTotal: +220 / −0 (220 changed lines), 1 commit.
Testing performed
ruff check→ All checks passed;ruff format --check→ cleanpython manage.py check→ no issueslocal_id prefix, stateREADY, typeLOCAL,language_codeforwarded,2 participants created, recording
IN_PROGRESSlength, missing audio) and oversize → 413
ENDED, transcript contains text"You", system labelled"Others"; blank-name case yields no labeldelete_data→DATA_DELETED, utterances removedCoding-guidelines compliance
any limit.
LocalSessionAudioView.postis 54 lines (over the 50 guidance) becauseof exhaustive request validation. Recommend extracting the validation block in a follow-up.
SUPPORTED_SAMPLE_RATES,MAX_SEGMENT_BYTES,LOCAL_SESSION_MEETING_URL,participant UUID/name constants — no magic values.
correct status code; nothing fails silently.
Risks / notes
in PR 4. No production clients exist yet, so there is no real exposure window — but PR 4 should
land before release.
Bot.meeting_urlis non-nullable, so a local session carries the sentinel"local_recording",exactly as app sessions use
"app_session".