-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add transcript format parameter to GET endpoint #709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
Add transcript_format query parameter to /v1/transcripts/{id} endpoint
with support for multiple output formats using discriminated unions.
Formats supported:
- text: Plain speaker dialogue (default)
- text-timestamped: Dialogue with [MM:SS] timestamps
- webvtt-named: WebVTT subtitles with participant names
- json: Structured segments with full metadata
Response models use Pydantic discriminated unions with transcript_format
as discriminator field. POST/PATCH endpoints return GetTranscriptWithParticipants
for minimal responses. GET endpoint returns format-specific models.
b6e52d3 to
65d4909
Compare
Summary
Adds
transcript_formatquery parameter toGET /v1/transcripts/{id}endpoint, enabling multiple output formats for transcript data. Uses Pydantic discriminated unions for type-safe API responses.Formats Supported
text(default)Plain dialogue with speaker names.
Query:
GET /v1/transcripts/{id}?transcript_format=textResponse:
{ "id": "transcript_123", "title": "Product Meeting", "duration": 1847.5, "transcript_format": "text", "transcript": "John Smith: Hello everyone, welcome to the meeting.\nJane Doe: Thanks for having me.\nJohn Smith: Let's get started.", "participants": [ {"id": "p1", "speaker": 0, "name": "John Smith"}, {"id": "p2", "speaker": 1, "name": "Jane Doe"} ], ... }text-timestampedDialogue with
[MM:SS]timestamp prefixes.Query:
GET /v1/transcripts/{id}?transcript_format=text-timestampedResponse:
{ "id": "transcript_123", "title": "Product Meeting", "duration": 1847.5, "transcript_format": "text-timestamped", "transcript": "[00:00] John Smith: Hello everyone, welcome to the meeting.\n[00:03] Jane Doe: Thanks for having me.\n[00:07] John Smith: Let's get started.", "participants": [ {"id": "p1", "speaker": 0, "name": "John Smith"}, {"id": "p2", "speaker": 1, "name": "Jane Doe"} ], ... }webvtt-namedWebVTT subtitle format with participant names.
Query:
GET /v1/transcripts/{id}?transcript_format=webvtt-namedResponse:
{ "id": "transcript_123", "title": "Product Meeting", "duration": 1847.5, "transcript_format": "webvtt-named", "transcript": "WEBVTT\n\n00:00:00.000 --> 00:00:03.000\n<v John Smith>Hello everyone, welcome to the meeting.\n\n00:00:03.000 --> 00:00:05.500\n<v Jane Doe>Thanks for having me.", "participants": [ {"id": "p1", "speaker": 0, "name": "John Smith"}, {"id": "p2", "speaker": 1, "name": "Jane Doe"} ], ... }jsonStructured segments with full metadata.
Query:
GET /v1/transcripts/{id}?transcript_format=jsonResponse:
{ "id": "transcript_123", "title": "Product Meeting", "duration": 1847.5, "transcript_format": "json", "transcript": [ { "speaker": 0, "speaker_name": "John Smith", "text": "Hello everyone, welcome to the meeting.", "start": 0.0, "end": 3.0 }, { "speaker": 1, "speaker_name": "Jane Doe", "text": "Thanks for having me.", "start": 3.0, "end": 5.5 }, ... ], "participants": [ {"id": "p1", "speaker": 0, "name": "John Smith"}, {"id": "p2", "speaker": 1, "name": "Jane Doe"} ], ... }Technical Details
transcript_formatas discriminatortextfor backward compatibilityGetTranscriptWithParticipants(minimal response)docs/transcript.md