Repository navigation
feat(bindings): who-said-what format parity for Python and C FFI - #29
Merged
Merged
Conversation
- C FFI: polyvoice_pipeline_run_format(..., format, ...) renders JSON/RTTM/ SRT/VTT/TXT via a new PolyvoiceFormat selector; the existing polyvoice_pipeline_run ABI is untouched. Header + module contract updated. - Python: typed DiarizationResult (from_json / to_json / to_rttm / to_srt / to_vtt / to_txt / to_dict + turns/speakers getters) and Pipeline.run_result(); .pyi stubs + py.typed ship in the wheel; __version__ now reflects installed package metadata. - WebVTT: transcribed cues use the standard voice span <v SPEAKER_NN>text</v>; cue text is sanitized for single-line payloads (newlines, "-->") and spec-escaped (& <) across SRT/VTT. - Python to_rttm validates file_id (RTTM is whitespace-delimited). - examples/agent_quickstart.md: machine-readable integration paths; python README gets the honest collar-disclosed DER row. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…st fresh advisories anyhow 1.0.102 -> 1.0.103 (unsound Error::downcast_mut, RUSTSEC-2026-0190); crossbeam-epoch 0.9.18 -> 0.9.20 (invalid pointer deref in fmt::Pointer, RUSTSEC-2026-0204). Lockfile-only, both semver-compatible. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ekhodzitsky
added a commit
that referenced
this pull request
Jul 31, 2026
* chore: ignore local git worktrees * feat(bindings): who-said-what format parity for Python and C FFI - C FFI: polyvoice_pipeline_run_format(..., format, ...) renders JSON/RTTM/ SRT/VTT/TXT via a new PolyvoiceFormat selector; the existing polyvoice_pipeline_run ABI is untouched. Header + module contract updated. - Python: typed DiarizationResult (from_json / to_json / to_rttm / to_srt / to_vtt / to_txt / to_dict + turns/speakers getters) and Pipeline.run_result(); .pyi stubs + py.typed ship in the wheel; __version__ now reflects installed package metadata. - WebVTT: transcribed cues use the standard voice span <v SPEAKER_NN>text</v>; cue text is sanitized for single-line payloads (newlines, "-->") and spec-escaped (& <) across SRT/VTT. - Python to_rttm validates file_id (RTTM is whitespace-delimited). - examples/agent_quickstart.md: machine-readable integration paths; python README gets the honest collar-disclosed DER row. * chore: rustfmt the new FFI code; update anyhow and crossbeam-epoch past fresh advisories anyhow 1.0.102 -> 1.0.103 (unsound Error::downcast_mut, RUSTSEC-2026-0190); crossbeam-epoch 0.9.18 -> 0.9.20 (invalid pointer deref in fmt::Pointer, RUSTSEC-2026-0204). Lockfile-only, both semver-compatible. --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ekhodzitsky
added a commit
that referenced
this pull request
Jul 31, 2026
* chore: ignore local git worktrees * feat(bindings): who-said-what format parity for Python and C FFI - C FFI: polyvoice_pipeline_run_format(..., format, ...) renders JSON/RTTM/ SRT/VTT/TXT via a new PolyvoiceFormat selector; the existing polyvoice_pipeline_run ABI is untouched. Header + module contract updated. - Python: typed DiarizationResult (from_json / to_json / to_rttm / to_srt / to_vtt / to_txt / to_dict + turns/speakers getters) and Pipeline.run_result(); .pyi stubs + py.typed ship in the wheel; __version__ now reflects installed package metadata. - WebVTT: transcribed cues use the standard voice span <v SPEAKER_NN>text</v>; cue text is sanitized for single-line payloads (newlines, "-->") and spec-escaped (& <) across SRT/VTT. - Python to_rttm validates file_id (RTTM is whitespace-delimited). - examples/agent_quickstart.md: machine-readable integration paths; python README gets the honest collar-disclosed DER row. * chore: rustfmt the new FFI code; update anyhow and crossbeam-epoch past fresh advisories anyhow 1.0.102 -> 1.0.103 (unsound Error::downcast_mut, RUSTSEC-2026-0190); crossbeam-epoch 0.9.18 -> 0.9.20 (invalid pointer deref in fmt::Pointer, RUSTSEC-2026-0204). Lockfile-only, both semver-compatible. ---------
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.
Closes the language-parity gap for who-said-what surfaces: the canonical
DiarizationResultv1 is now projectable to every format from Python and C, not just the CLI.C FFI
polyvoice_pipeline_run_format(..., format, ...)— renders the result as JSON / RTTM / SRT / VTT / TXT via a newPolyvoiceFormat(polyvoice_format_t) selector. Same contract aspolyvoice_pipeline_runotherwise; RTTM uses the fixed file idaudio; unknown formats returnInvalidArgbefore the pipeline is touched.include/polyvoice.hand the module contract updated (also fixed stalepolyvoice_pipeline_freenaming →polyvoice_pipeline_destroy, ABI v2 → v3).Python
DiarizationResult:from_json()/to_json()/to_rttm(file_id)/to_srt()/to_vtt()/to_txt()/to_dict()+turns/speakers/num_speakers/schema_versiongetters.Pipeline.run_result()returns it;Pipeline.run()(plain dict) unchanged..pyistubs +py.typedmarker ship in the wheel;__version__now reads installed metadata (was a stale hardcoded string).to_rttmvalidatesfile_id(RTTM is whitespace-delimited — a space would silently corrupt columns).Format writers (shared by CLI / FFI / Python)
<v SPEAKER_NN>text</v>(diarization-only cues keep the bare label).-->broken up) and VTT-escaped (&→&,<→<) — hostile/ASR text can no longer break block structure.Docs
examples/agent_quickstart.md— copy-paste integration paths (CLI--json, MCP, Python typed result, FFI formats, who-said-what from source).Verification
cargo nextest run --all-features: 419 passed.cargo clippy --all-targets --all-features -- -D warnings: clean.ffi_run_format_renders_every_format(all five formats + unknown-format rejection on a valid handle) passes on real cached models.maturin develop+pytest: 13 passed (golden projections for all five formats, JSON round-trip, v1-consumer compat, file_id validation).🤖 Generated with Claude Code