Skip to content
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

Disable Server_VAD in VoiceActivityDetectionSettings #339

Open
timbowicz opened this issue Feb 4, 2025 · 1 comment · May be fixed by #341
Open

Disable Server_VAD in VoiceActivityDetectionSettings #339

timbowicz opened this issue Feb 4, 2025 · 1 comment · May be fixed by #341
Assignees
Labels
bug Something isn't working

Comments

@timbowicz
Copy link

timbowicz commented Feb 4, 2025

Hi Stephen, first of all great work with the openai implementation.

I want to mimic push to talk functionality with the realtime streaming model. From what I read in the openai documentation you have to disable the 'Server_VAD' for that and send the audio input manually.

I've done this :

var options = new Options(
    model: Model.GPT4oRealtime,
    instructions: systemPrompt,
    voice:voice,
    turnDetectionSettings: new VoiceActivityDetectionSettings(TurnDetectionType.Disabled));
                
session = await openAI.RealtimeEndpoint.CreateSessionAsync(options, destroyCancellationToken);

But it throws this error :

Exception: [missing_required_parameter] Missing required parameter: 'session.turn_detection.type'. Type: invalid_request_error Parameter: session.turn_detection.type
Utilities.Async.AwaiterExtensions.WithCancellation[T] (System.Threading.Tasks.Task`1[TResult] task, System.Threading.CancellationToken cancellationToken) (at ./Library/PackageCache/[email protected]/Runtime/Async/AwaiterExtensions.cs:163)
OpenAI.Realtime.RealtimeSession.SendAsync[T] (T event, System.Action`1[T] sessionEvents, System.Threading.CancellationToken cancellationToken) (at ./Library/PackageCache/[email protected]/Runtime/Realtime/RealtimeSession.cs:293)
OpenAI.Realtime.RealtimeSession.SendAsync[T] (T event, System.Threading.CancellationToken cancellationToken) (at ./Library/PackageCache/[email protected]/Runtime/Realtime/RealtimeSession.cs:224)
OpenAI.Realtime.RealtimeEndpoint.CreateSessionAsync (OpenAI.Realtime.Options options, System.Threading.CancellationToken cancellationToken) (at ./Library/PackageCache/[email protected]/Runtime/Realtime/RealtimeEndpoint.cs:52)

It looks like you didn't include the possibility to disable Server_VAD in the VoiceActivityDetectionSettings class.

@StephenHodgson
Copy link
Member

Thanks Tim for the kind words. I'll look into this and make sure it's working correctly. They updated the API schema this week so maybe related.

@StephenHodgson StephenHodgson self-assigned this Feb 4, 2025
@StephenHodgson StephenHodgson added the bug Something isn't working label Feb 4, 2025
@StephenHodgson StephenHodgson linked a pull request Feb 9, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

2 participants