Skip to content

feat(audio): add chunking_strategy field to AudioRequest#1102

Open
alnah wants to merge 1 commit intosashabaranov:masterfrom
alnah:feat/audio-diarization-support
Open

feat(audio): add chunking_strategy field to AudioRequest#1102
alnah wants to merge 1 commit intosashabaranov:masterfrom
alnah:feat/audio-diarization-support

Conversation

@alnah
Copy link

@alnah alnah commented Jan 29, 2026

Summary

Adds chunking_strategy field to AudioRequest and full speaker diarization support:

  • ChunkingStrategy *TranscriptionChunkingStrategy field in AudioRequest
  • AudioChunkingStrategyAuto and AudioChunkingStrategyServerVAD constants
  • AudioResponseFormatDiarizedJSON response format
  • CreateDiarizedTranscription method with DiarizedAudioResponse return type
  • DiarizedSegment and AudioUsage types for response parsing

Closes #1101

Usage

resp, err := client.CreateDiarizedTranscription(ctx, openai.AudioRequest{
    Model:    "gpt-4o-transcribe-diarize",
    FilePath: "audio.mp3",
    Format:   openai.AudioResponseFormatDiarizedJSON,
    ChunkingStrategy: &openai.TranscriptionChunkingStrategy{
        Type: openai.AudioChunkingStrategyAuto,
    },
})

Test plan

  • go test -race -cover ./... passes (99.5% coverage)
  • go vet ./... passes
  • staticcheck ./... passes
  • golangci-lint run passes (only pre-existing issues in unrelated files)

@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.62%. Comparing base (5d7a276) to head (f98e487).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1102      +/-   ##
==========================================
+ Coverage   99.59%   99.62%   +0.03%     
==========================================
  Files          34       34              
  Lines        2209     1876     -333     
==========================================
- Hits         2200     1869     -331     
+ Misses          6        4       -2     
  Partials        3        3              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alnah alnah force-pushed the feat/audio-diarization-support branch from a85bdd8 to f2eb234 Compare January 29, 2026 01:47
@alnah alnah force-pushed the feat/audio-diarization-support branch from f2eb234 to f98e487 Compare January 29, 2026 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AudioRequest missing chunking_strategy field

1 participant