Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion OpenAI-DotNet/OpenAI-DotNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ More context [on Roger Pincombe's blog](https://rogerpincombe.com/openai-dotnet-
<AssemblyOriginatorKeyFile>OpenAI-DotNet.pfx</AssemblyOriginatorKeyFile>
<IncludeSymbols>true</IncludeSymbols>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Version>8.8.6</Version>
<Version>8.8.7</Version>
<PackageReleaseNotes>
Version 8.8.7
- Fix VAD serialization not properly setting disabled values
Version 8.8.6
- Fix Realtime.UpdateSessionRequests failing to update session due to extra client secret data
Version 8.8.4
Expand Down
4 changes: 2 additions & 2 deletions OpenAI-DotNet/Realtime/DisabledVAD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ public sealed class DisabledVAD : IVoiceActivityDetectionSettings
{
public TurnDetectionType Type => TurnDetectionType.Disabled;

public bool CreateResponse => false;
public bool? CreateResponse => null;

public bool InterruptResponse => false;
public bool? InterruptResponse => null;
}
}
4 changes: 2 additions & 2 deletions OpenAI-DotNet/Realtime/IVoiceActivityDetectionSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
public interface IVoiceActivityDetectionSettings
{
public TurnDetectionType Type { get; }
public bool CreateResponse { get; }
public bool InterruptResponse { get; }
public bool? CreateResponse { get; }
public bool? InterruptResponse { get; }
}
}
11 changes: 8 additions & 3 deletions OpenAI-DotNet/Realtime/SemanticVAD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ public sealed class SemanticVAD : IVoiceActivityDetectionSettings
{
public SemanticVAD() { }

public SemanticVAD(bool createResponse = true, bool interruptResponse = true, VAD_Eagerness eagerness = VAD_Eagerness.Auto)
public SemanticVAD(
bool? createResponse = true,
bool? interruptResponse = true,
VAD_Eagerness eagerness = VAD_Eagerness.Auto)
{
CreateResponse = createResponse;
InterruptResponse = interruptResponse;
Expand All @@ -20,11 +23,13 @@ public SemanticVAD(bool createResponse = true, bool interruptResponse = true, VA

[JsonInclude]
[JsonPropertyName("create_response")]
public bool CreateResponse { get; private set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? CreateResponse { get; private set; }

[JsonInclude]
[JsonPropertyName("interrupt_response")]
public bool InterruptResponse { get; private set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? InterruptResponse { get; private set; }

[JsonInclude]
[JsonPropertyName("eagerness")]
Expand Down
10 changes: 6 additions & 4 deletions OpenAI-DotNet/Realtime/ServerVAD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ public sealed class ServerVAD : IVoiceActivityDetectionSettings
public ServerVAD() { }

public ServerVAD(
bool createResponse = true,
bool interruptResponse = true,
bool? createResponse = true,
bool? interruptResponse = true,
int? prefixPadding = null,
int? silenceDuration = null,
float? detectionThreshold = null)
Expand All @@ -27,11 +27,13 @@ public ServerVAD(

[JsonInclude]
[JsonPropertyName("create_response")]
public bool CreateResponse { get; private set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? CreateResponse { get; private set; }

[JsonInclude]
[JsonPropertyName("interrupt_response")]
public bool InterruptResponse { get; private set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? InterruptResponse { get; private set; }

[JsonInclude]
[JsonPropertyName("prefix_padding_ms")]
Expand Down
12 changes: 6 additions & 6 deletions OpenAI-DotNet/Realtime/VoiceActivityDetectionSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public VoiceActivityDetectionSettings(
float? detectionThreshold = null,
int? prefixPadding = null,
int? silenceDuration = null,
bool createResponse = true)
bool? createResponse = true)
{
switch (type)
{
Expand All @@ -32,7 +32,7 @@ public VoiceActivityDetectionSettings(
DetectionThreshold = null;
PrefixPadding = null;
SilenceDuration = null;
CreateResponse = false;
CreateResponse = null;
break;
}
}
Expand All @@ -45,13 +45,13 @@ public VoiceActivityDetectionSettings(

[JsonInclude]
[JsonPropertyName("create_response")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public bool CreateResponse { get; private set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? CreateResponse { get; private set; }

[JsonInclude]
[JsonPropertyName("interrupt_response")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public bool InterruptResponse { get; private set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? InterruptResponse { get; private set; }

[JsonInclude]
[JsonPropertyName("threshold")]
Expand Down
Loading