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 @@ -74,61 +74,33 @@ public DeepgramListenV1RealtimeClient(
/// Connects to the WebSocket server with typed query parameters.
/// </summary>
/// <param name="callback">URL to which we'll make the callback request</param>
/// <param name="callbackMethod">HTTP method by which the callback request will be made</param>
/// <param name="channels">The number of channels in the submitted audio</param>
/// <param name="detectEntities">Identifies and extracts key entities from content in submitted audio. Entities appear in final results. When enabled, Punctuation will also be enabled by default</param>
/// <param name="diarize">Defaults to `false`. Recognize speaker changes. Each word in the transcript will be assigned a speaker number starting at 0</param>
/// <param name="dictation">Identify and extract key entities from content in submitted audio</param>
/// <param name="encoding">Specify the expected encoding of your submitted audio</param>
/// <param name="endpointing">Indicates how long Deepgram will wait to detect whether a speaker has finished speaking or pauses for a significant period of time. When set to a value, the streaming endpoint immediately finalizes the transcription for the processed time range and returns the transcript with a speech_final parameter set to true. Can also be set to false to disable endpointing</param>
/// <param name="extra">Arbitrary key-value pairs that are attached to the API response for usage in downstream processing</param>
/// <param name="interimResults">Specifies whether the streaming endpoint should provide ongoing transcription updates as more audio is received. When set to true, the endpoint sends continuous updates, meaning transcription results may evolve over time</param>
/// <param name="keyterm">Key term prompting can boost specialized terminology and brands. Only compatible with Nova-3</param>
/// <param name="keywords">Keywords can boost or suppress specialized terminology and brands</param>
/// <param name="language">The [BCP-47 language tag](https://tools.ietf.org/html/bcp47) that hints at the primary spoken language. Depending on the Model you choose only certain languages are available</param>
/// <param name="mipOptOut">Opts out requests from the Deepgram Model Improvement Program. Refer to our Docs for pricing impacts before setting this to true. https://dpgr.am/deepgram-mip</param>
/// <param name="model">AI model to use for the transcription</param>
/// <param name="multichannel">Transcribe each audio channel independently</param>
/// <param name="numerals">Convert numbers from written format to numerical format</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="punctuate">Add punctuation and capitalization to the transcript</param>
/// <param name="redact">Redaction removes sensitive information from your transcripts</param>
/// <param name="replace">Search for terms or phrases in submitted audio and replaces them</param>
/// <param name="sampleRate">Sample rate of submitted audio. Required (and only read) when a value is provided for encoding</param>
/// <param name="search">Search for terms or phrases in submitted audio</param>
/// <param name="smartFormat">Apply formatting to transcript output. When set to true, additional formatting will be applied to transcripts to improve readability</param>
/// <param name="tag">Label your requests for the purpose of identification during usage reporting</param>
/// <param name="utteranceEndMs">Indicates how long Deepgram will wait to send an UtteranceEnd message after a word has been transcribed. Use with interim_results</param>
/// <param name="vadEvents">Indicates that speech has started. You'll begin receiving Speech Started messages upon speech starting</param>
/// <param name="version">Version of an AI model to use</param>
public async global::System.Threading.Tasks.Task ConnectAsync(
object? callback = default,
global::Deepgram.Realtime.ListenV1CallbackMethod? callbackMethod = default,
object? channels = default,
global::Deepgram.Realtime.ListenV1DetectEntities? detectEntities = default,
global::Deepgram.Realtime.ListenV1Diarize? diarize = default,
global::Deepgram.Realtime.ListenV1Dictation? dictation = default,
global::Deepgram.Realtime.ListenV1Encoding? encoding = default,
object? endpointing = default,
object? extra = default,
global::Deepgram.Realtime.ListenV1InterimResults? interimResults = default,
object? keyterm = default,
object? keywords = default,
object? language = default,
object? mipOptOut = default,
global::Deepgram.Realtime.ListenV1Model? model = default,
global::Deepgram.Realtime.ListenV1Multichannel? multichannel = default,
global::Deepgram.Realtime.ListenV1Numerals? numerals = default,
global::Deepgram.Realtime.ListenV1ProfanityFilter? profanityFilter = default,
global::Deepgram.Realtime.ListenV1Punctuate? punctuate = default,
global::Deepgram.Realtime.ListenV1Redact? redact = default,
object? replace = default,
object? sampleRate = default,
object? search = default,
global::Deepgram.Realtime.ListenV1SmartFormat? smartFormat = default,
object? tag = default,
object? utteranceEndMs = default,
global::Deepgram.Realtime.ListenV1VadEvents? vadEvents = default,
object? version = default,
global::System.Uri? uri = null,
global::System.Threading.CancellationToken cancellationToken = default)
Expand All @@ -137,32 +109,18 @@ public DeepgramListenV1RealtimeClient(
path: uri?.ToString() ?? DefaultBaseUrl);
__pathBuilder
.AddOptionalParameter("callback", callback?.ToString())
.AddOptionalParameter("callback_method", callbackMethod?.ToValueString())
.AddOptionalParameter("channels", channels?.ToString())
.AddOptionalParameter("detect_entities", detectEntities?.ToValueString())
.AddOptionalParameter("diarize", diarize?.ToValueString())
.AddOptionalParameter("dictation", dictation?.ToValueString())
.AddOptionalParameter("encoding", encoding?.ToValueString())
.AddOptionalParameter("endpointing", endpointing?.ToString())
.AddOptionalParameter("extra", extra?.ToString())
.AddOptionalParameter("interim_results", interimResults?.ToValueString())
.AddOptionalParameter("keyterm", keyterm?.ToString())
.AddOptionalParameter("keywords", keywords?.ToString())
.AddOptionalParameter("language", language?.ToString())
.AddOptionalParameter("mip_opt_out", mipOptOut?.ToString())
.AddOptionalParameter("model", model?.ToValueString())
.AddOptionalParameter("multichannel", multichannel?.ToValueString())
.AddOptionalParameter("numerals", numerals?.ToValueString())
.AddOptionalParameter("profanity_filter", profanityFilter?.ToValueString())
.AddOptionalParameter("punctuate", punctuate?.ToValueString())
.AddOptionalParameter("redact", redact?.ToValueString())
.AddOptionalParameter("replace", replace?.ToString())
.AddOptionalParameter("sample_rate", sampleRate?.ToString())
.AddOptionalParameter("search", search?.ToString())
.AddOptionalParameter("smart_format", smartFormat?.ToValueString())
.AddOptionalParameter("tag", tag?.ToString())
.AddOptionalParameter("utterance_end_ms", utteranceEndMs?.ToString())
.AddOptionalParameter("vad_events", vadEvents?.ToValueString())
.AddOptionalParameter("version", version?.ToString())
;
var __path = __pathBuilder.ToString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,15 @@ public DeepgramListenV2RealtimeClient(
/// <summary>
/// Connects to the WebSocket server with typed query parameters.
/// </summary>
/// <param name="model">Defines the AI model used to process submitted audio.</param>
/// <param name="eagerEotThreshold">End-of-turn confidence required to fire an eager end-of-turn event. When set, enables `EagerEndOfTurn` and `TurnResumed` events. Valid Values 0.3 - 0.9.</param>
/// <param name="encoding">Encoding of the audio stream. Required if sending non-containerized/raw audio. If sending containerized audio, this parameter should be omitted.</param>
/// <param name="eotThreshold">End-of-turn confidence required to finish a turn. Valid Values 0.5 - 0.9.</param>
/// <param name="eotTimeoutMs">A turn will be finished when this much time has passed after speech, regardless of EOT confidence.</param>
/// <param name="keyterm">Keyterm prompting can improve recognition of specialized terminology. Pass multiple keyterm query parameters to boost multiple keyterms.</param>
/// <param name="mipOptOut">Opts out requests from the Deepgram Model Improvement Program. Refer to our Docs for pricing impacts before setting this to true. https://dpgr.am/deepgram-mip</param>
/// <param name="sampleRate">Sample rate of the audio stream in Hz. Required if sending non-containerized/raw audio. If sending containerized audio, this parameter should be omitted.</param>
/// <param name="tag">Label your requests for the purpose of identification during usage reporting</param>
public async global::System.Threading.Tasks.Task ConnectAsync(
global::Deepgram.Realtime.ListenV2Model model,
object? eagerEotThreshold = default,
global::Deepgram.Realtime.ListenV2Encoding? encoding = default,
object? eotThreshold = default,
object? eotTimeoutMs = default,
global::Deepgram.Realtime.ListenV2Keyterm? keyterm = default,
Expand All @@ -99,9 +95,7 @@ public DeepgramListenV2RealtimeClient(
var __pathBuilder = new global::Deepgram.Realtime.PathBuilder(
path: uri?.ToString() ?? DefaultBaseUrl);
__pathBuilder
.AddRequiredParameter("model", model.ToValueString())
.AddOptionalParameter("eager_eot_threshold", eagerEotThreshold?.ToString())
.AddOptionalParameter("encoding", encoding?.ToValueString())
.AddOptionalParameter("eot_threshold", eotThreshold?.ToString())
.AddOptionalParameter("eot_timeout_ms", eotTimeoutMs?.ToString())
.AddOptionalParameter("keyterm", keyterm?.ToString())
Expand All @@ -115,16 +109,6 @@ await _clientWebSocket.ConnectAsync(
new global::System.Uri(__path), cancellationToken).ConfigureAwait(false);
}

/// <inheritdoc cref="global::System.Net.WebSockets.ClientWebSocket.ConnectAsync(global::System.Uri, global::System.Threading.CancellationToken)"/>
public async global::System.Threading.Tasks.Task ConnectAsync(
global::System.Uri? uri = null,
global::System.Threading.CancellationToken cancellationToken = default)
{
uri ??= new global::System.Uri(DefaultBaseUrl);

await _clientWebSocket.ConnectAsync(uri, cancellationToken).ConfigureAwait(false);
}

/// <summary>
/// Sends a raw text message over the WebSocket connection.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,25 +73,16 @@ public DeepgramSpeakV1RealtimeClient(
/// <summary>
/// Connects to the WebSocket server with typed query parameters.
/// </summary>
/// <param name="encoding">Encoding allows you to specify the expected encoding of your audio output for streaming TTS. Only streaming-compatible encodings are supported.</param>
/// <param name="mipOptOut">Opts out requests from the Deepgram Model Improvement Program. Refer to our Docs for pricing impacts before setting this to true. https://dpgr.am/deepgram-mip</param>
/// <param name="model">AI model used to process submitted text</param>
/// <param name="sampleRate">Sample Rate specifies the sample rate for the output audio. Based on encoding 8000 or 24000 are possible defaults. For some encodings sample rate is not configurable.</param>
public async global::System.Threading.Tasks.Task ConnectAsync(
global::Deepgram.Realtime.SpeakV1Encoding? encoding = default,
object? mipOptOut = default,
global::Deepgram.Realtime.SpeakV1Model? model = default,
global::Deepgram.Realtime.SpeakV1SampleRate? sampleRate = default,
global::System.Uri? uri = null,
global::System.Threading.CancellationToken cancellationToken = default)
{
var __pathBuilder = new global::Deepgram.Realtime.PathBuilder(
path: uri?.ToString() ?? DefaultBaseUrl);
__pathBuilder
.AddOptionalParameter("encoding", encoding?.ToValueString())
.AddOptionalParameter("mip_opt_out", mipOptOut?.ToString())
.AddOptionalParameter("model", model?.ToValueString())
.AddOptionalParameter("sample_rate", sampleRate?.ToValueString())
;
var __path = __pathBuilder.ToString();

Expand Down
Loading