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
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ private void ApplyConnectionOptions(
/// <param name="languageHint">Language hints constrain and prioritize language detection for the flux-general-multi model. Pass multiple language_hint query parameters to specify multiple language codes. Empty values are rejected. Only valid when model is flux-general-multi.</param>
/// <param name="mipOptOut">Any type</param>
/// <param name="model">Defines the AI model used to process submitted audio.</param>
/// <param name="profanityFilter">Profanity Filter looks for recognized profanity and converts it to the nearest recognized non-profane word or removes it from the transcript completely.</param>
/// <param name="sampleRate">Any type</param>
/// <param name="tag">Any type</param>
/// <param name="uri">Optional WebSocket endpoint override.</param>
Expand All @@ -546,6 +547,7 @@ private void ApplyConnectionOptions(
global::Deepgram.Realtime.ListenV2LanguageHint? languageHint = default,
global::Deepgram.Realtime.ListenV2MipOptOut? mipOptOut = default,
global::Deepgram.Realtime.ListenV2Model? model = default,
global::Deepgram.Realtime.ListenV2ProfanityFilter? profanityFilter = default,
global::Deepgram.Realtime.ListenV2SampleRate? sampleRate = default,
global::Deepgram.Realtime.ListenV2Tag? tag = default,
global::System.Uri? uri = null,
Expand Down Expand Up @@ -574,6 +576,7 @@ private void ApplyConnectionOptions(
.AddOptionalParameter("language_hint", languageHint?.ToString())
.AddOptionalParameter("mip_opt_out", mipOptOut?.ToString())
.AddOptionalParameter("model", model?.ToValueString())
.AddOptionalParameter("profanity_filter", profanityFilter?.ToValueString())
.AddOptionalParameter("sample_rate", sampleRate?.ToString())
.AddOptionalParameter("tag", tag?.ToString())
;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

namespace Deepgram.Realtime.JsonConverters
{
/// <inheritdoc />
public sealed class ListenV2ProfanityFilterJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Deepgram.Realtime.ListenV2ProfanityFilter>
{
/// <inheritdoc />
public override global::Deepgram.Realtime.ListenV2ProfanityFilter Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::Deepgram.Realtime.ListenV2ProfanityFilterExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::Deepgram.Realtime.ListenV2ProfanityFilter)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::Deepgram.Realtime.ListenV2ProfanityFilter);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Deepgram.Realtime.ListenV2ProfanityFilter value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::Deepgram.Realtime.ListenV2ProfanityFilterExtensions.ToValueString(value));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#nullable enable

namespace Deepgram.Realtime.JsonConverters
{
/// <inheritdoc />
public sealed class ListenV2ProfanityFilterNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Deepgram.Realtime.ListenV2ProfanityFilter?>
{
/// <inheritdoc />
public override global::Deepgram.Realtime.ListenV2ProfanityFilter? Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::Deepgram.Realtime.ListenV2ProfanityFilterExtensions.ToEnum(stringValue);
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::Deepgram.Realtime.ListenV2ProfanityFilter)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::Deepgram.Realtime.ListenV2ProfanityFilter?);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Deepgram.Realtime.ListenV2ProfanityFilter? value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

if (value == null)
{
writer.WriteNullValue();
}
else
{
writer.WriteStringValue(global::Deepgram.Realtime.ListenV2ProfanityFilterExtensions.ToValueString(value.Value));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,10 @@ namespace Deepgram.Realtime

typeof(global::Deepgram.Realtime.JsonConverters.ListenV2EncodingNullableJsonConverter),

typeof(global::Deepgram.Realtime.JsonConverters.ListenV2ProfanityFilterJsonConverter),

typeof(global::Deepgram.Realtime.JsonConverters.ListenV2ProfanityFilterNullableJsonConverter),

typeof(global::Deepgram.Realtime.JsonConverters.ChannelsListenV2MessagesListenV2ConnectedTypeJsonConverter),

typeof(global::Deepgram.Realtime.JsonConverters.ChannelsListenV2MessagesListenV2ConnectedTypeNullableJsonConverter),
Expand Down Expand Up @@ -734,6 +738,7 @@ namespace Deepgram.Realtime
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Deepgram.Realtime.ListenV2EotTimeoutMs))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Deepgram.Realtime.ListenV2Keyterm), TypeInfoPropertyName = "ListenV2Keyterm2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Deepgram.Realtime.ListenV2LanguageHint), TypeInfoPropertyName = "ListenV2LanguageHint2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Deepgram.Realtime.ListenV2ProfanityFilter), TypeInfoPropertyName = "ListenV2ProfanityFilter2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Deepgram.Realtime.ListenV2MipOptOut))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Deepgram.Realtime.ListenV2Tag))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Deepgram.Realtime.ChannelsListenV2MessagesListenV2ConnectedType), TypeInfoPropertyName = "ChannelsListenV2MessagesListenV2ConnectedType2")]
Expand Down
Loading