From 0a67e062b1a591d7d09991461bc3ca0efe4bbb17 Mon Sep 17 00:00:00 2001 From: dvonthenen Date: Sun, 4 Feb 2024 11:30:09 -0800 Subject: [PATCH] Audit of Live Model Classes --- Deepgram/Models/Live/v1/Alternative.cs | 4 +- Deepgram/Models/Live/v1/Average.cs | 6 + Deepgram/Models/Live/v1/Channel.cs | 6 - Deepgram/Models/Live/v1/EventResponse.cs | 4 + Deepgram/Models/Live/v1/Hit.cs | 24 ---- Deepgram/Models/Live/v1/Intent.cs | 18 --- Deepgram/Models/Live/v1/IntentSegment.cs | 29 ---- Deepgram/Models/Live/v1/Intents.cs | 11 -- Deepgram/Models/Live/v1/LiveSchema.cs | 135 ++++++------------ Deepgram/Models/Live/v1/Metadata.cs | 43 +++--- Deepgram/Models/Live/v1/MetadataResponse.cs | 67 +++++++-- Deepgram/Models/Live/v1/ModelInfo.cs | 15 +- Deepgram/Models/Live/v1/Search.cs | 13 -- Deepgram/Models/Live/v1/Segment.cs | 19 --- Deepgram/Models/Live/v1/SentimentGroup.cs | 30 ---- Deepgram/Models/Live/v1/SentimentInfo.cs | 18 --- Deepgram/Models/Live/v1/SentimentSegment.cs | 26 ---- Deepgram/Models/Live/v1/Sentiments.cs | 30 ---- .../Models/Live/v1/SpeechstartedResponse.cs | 23 +++ .../Models/Live/v1/TranscriptionResponse.cs | 57 +++++--- .../Models/Live/v1/UtteranceEndResponse.cs | 15 +- Deepgram/Models/Live/v1/Word.cs | 10 +- 22 files changed, 227 insertions(+), 376 deletions(-) delete mode 100644 Deepgram/Models/Live/v1/Hit.cs delete mode 100644 Deepgram/Models/Live/v1/Intent.cs delete mode 100644 Deepgram/Models/Live/v1/IntentSegment.cs delete mode 100644 Deepgram/Models/Live/v1/Intents.cs delete mode 100644 Deepgram/Models/Live/v1/Search.cs delete mode 100644 Deepgram/Models/Live/v1/Segment.cs delete mode 100644 Deepgram/Models/Live/v1/SentimentGroup.cs delete mode 100644 Deepgram/Models/Live/v1/SentimentInfo.cs delete mode 100644 Deepgram/Models/Live/v1/SentimentSegment.cs delete mode 100644 Deepgram/Models/Live/v1/Sentiments.cs create mode 100644 Deepgram/Models/Live/v1/SpeechstartedResponse.cs diff --git a/Deepgram/Models/Live/v1/Alternative.cs b/Deepgram/Models/Live/v1/Alternative.cs index e87c7a6b..206fcbc2 100644 --- a/Deepgram/Models/Live/v1/Alternative.cs +++ b/Deepgram/Models/Live/v1/Alternative.cs @@ -11,13 +11,11 @@ public record Alternative /// Value between 0 and 1 indicating the model's relative confidence in this transcript. /// [JsonPropertyName("confidence")] - public decimal? Confidence { get; set; } + public double? Confidence { get; set; } /// /// ReadOnly List of objects. /// [JsonPropertyName("words")] public IReadOnlyList? Words { get; set; } - - } diff --git a/Deepgram/Models/Live/v1/Average.cs b/Deepgram/Models/Live/v1/Average.cs index 24080a7a..55eb5b6e 100644 --- a/Deepgram/Models/Live/v1/Average.cs +++ b/Deepgram/Models/Live/v1/Average.cs @@ -2,9 +2,15 @@ public class Average { + /// + /// TODO + /// [JsonPropertyName("sentiment")] public string? Sentiment { get; set; } + /// + /// TODO + /// [JsonPropertyName("sentiment_score")] public double? SentimentScore { get; set; } } diff --git a/Deepgram/Models/Live/v1/Channel.cs b/Deepgram/Models/Live/v1/Channel.cs index bad4b606..7a6c7cc8 100644 --- a/Deepgram/Models/Live/v1/Channel.cs +++ b/Deepgram/Models/Live/v1/Channel.cs @@ -7,10 +7,4 @@ public record Channel /// [JsonPropertyName("alternatives")] public IReadOnlyList? Alternatives { get; set; } - - /// - /// - /// - [JsonPropertyName("search")] - public IReadOnlyList? Searches { get; set; } } diff --git a/Deepgram/Models/Live/v1/EventResponse.cs b/Deepgram/Models/Live/v1/EventResponse.cs index d250a5f0..9ca7d394 100644 --- a/Deepgram/Models/Live/v1/EventResponse.cs +++ b/Deepgram/Models/Live/v1/EventResponse.cs @@ -1,18 +1,22 @@ namespace Deepgram.Models.Live.v1; + public class EventResponse { /// /// MetaData response from the live transcription service /// public MetadataResponse? MetaData { get; set; } + /// /// Transcription response from the live transcription service /// public TranscriptionResponse? Transcription { get; set; } + /// /// UtterancEnd response from the live transcription service /// public UtteranceEndResponse? UtteranceEnd { get; set; } + /// /// Error response from the live transcription service /// diff --git a/Deepgram/Models/Live/v1/Hit.cs b/Deepgram/Models/Live/v1/Hit.cs deleted file mode 100644 index 68137a1e..00000000 --- a/Deepgram/Models/Live/v1/Hit.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace Deepgram.Models.Live.v1; - -public record Hit -{ - /// - /// - /// - public int Confidence { get; set; } - - /// - /// - /// - public int Start { get; set; } - - /// - /// - /// - public int End { get; set; } - - /// - /// - /// - public string Snippet { get; set; } -} \ No newline at end of file diff --git a/Deepgram/Models/Live/v1/Intent.cs b/Deepgram/Models/Live/v1/Intent.cs deleted file mode 100644 index 00c8c983..00000000 --- a/Deepgram/Models/Live/v1/Intent.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Deepgram.Models.Live.v1; - -public record Intent -{ - /// - /// - /// - [JsonPropertyName("intent")] - public string Intention { get; set; } - /// - /// - /// - [JsonPropertyName("confidence_score")] - public double ConfidenceScore { get; set; } -} - - - diff --git a/Deepgram/Models/Live/v1/IntentSegment.cs b/Deepgram/Models/Live/v1/IntentSegment.cs deleted file mode 100644 index c7343fea..00000000 --- a/Deepgram/Models/Live/v1/IntentSegment.cs +++ /dev/null @@ -1,29 +0,0 @@ -namespace Deepgram.Models.Live.v1; - -public record IntentSegment -{ - /// - /// - /// - [JsonPropertyName("text")] - public string Text { get; set; } - - /// - /// - /// - [JsonPropertyName("start_word")] - public int StartWord { get; set; } - - /// - /// - /// - [JsonPropertyName("end_word")] - public int EndWord { get; set; } - - /// - /// - /// - /// - [JsonPropertyName("intents")] - public IReadOnlyList Intents { get; set; } -} diff --git a/Deepgram/Models/Live/v1/Intents.cs b/Deepgram/Models/Live/v1/Intents.cs deleted file mode 100644 index 0d5e476a..00000000 --- a/Deepgram/Models/Live/v1/Intents.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Deepgram.Models.Live.v1; -public record Intents -{ - /// - /// - /// - /// - [JsonPropertyName("segments")] - public IReadOnlyList? Segments { get; set; } - -} diff --git a/Deepgram/Models/Live/v1/LiveSchema.cs b/Deepgram/Models/Live/v1/LiveSchema.cs index 1b3a6538..2ab1b34b 100644 --- a/Deepgram/Models/Live/v1/LiveSchema.cs +++ b/Deepgram/Models/Live/v1/LiveSchema.cs @@ -25,18 +25,13 @@ public class LiveSchema [JsonPropertyName("callback_method")] public bool? CallbackMethod { get; set; } - ///// - ///// Optional. A custom intent you want the model to detect within your input audio if present. Submit up to 100. - ///// - //[JsonPropertyName("custom_intent")] - //public string CustomIntent { get; set; } - - ///// - ///// Optional. Sets how the model will interpret strings submitted to the custom_intent param. When "strict", the model will only return intents submitted using the custom_intent param. When "extended", the model will return it's own detected intents in addition those submitted using the custom_intents param. - ///// - //[JsonPropertyName("custom_intent_mode")] - //public string CustomIntentMode { get; set; } - + /// + /// Channels allows you to specify the number of independent audio channels your submitted audio contains. + /// Used when the Encoding feature is also being used to submit streaming raw audio + /// + /// + [JsonPropertyName("channels")] + public int? Channels { get; set; } /// /// Diarize recognizes speaker changes and assigns a speaker to each word in the transcript. @@ -53,14 +48,28 @@ public class LiveSchema [JsonPropertyName("diarize_version")] public string? DiarizeVersion { get; set; } + /// + /// Encoding allows you to specify the expected encoding of your submitted audio. + /// + /// supported encodings + /// + [JsonPropertyName("encoding")] + public string? Encoding { get; set; } + + /// + /// Endpointing returns transcripts when pauses in speech are detected. + /// + /// + [JsonPropertyName("endpointing")] + public string? EndPointing { get; set; } + /// /// Deepgram’s Extra Metadata feature allows you to attach arbitrary key-value pairs to your API requests that are attached to the API response for usage in downstream processing. /// Extra metadata is limited to 2048 characters per key-value pair. /// /// [JsonPropertyName("extra")] - public Dictionary Extra { get; set; } - + public Dictionary? Extra { get; set; } /// /// Whether to include words like "uh" and "um" in transcription output. @@ -69,11 +78,12 @@ public class LiveSchema [JsonPropertyName("filler_words")] public bool? FillerWords { get; set; } - ///// - ///// Enables intent recognition - ///// - //[JsonPropertyName("intents")] - //public bool? Intents { get; set; } + /// + /// Interim Results provides preliminary results for streaming audio to solve the need for immediate results combined with high levels of accuracy. + /// + /// + [JsonPropertyName("interim_results")] + public bool? InterimResults { get; set; } /// /// Keywords can boost or suppress specialized terminology. @@ -137,6 +147,14 @@ public class LiveSchema [JsonPropertyName("replace")] public List? Replace { get; set; } + /// + /// Sample Rate allows you to specify the sample rate of your submitted audio. + /// + /// only applies when Encoding has a value + /// + [JsonPropertyName("sample_rate")] + public int? SampleRate { get; set; } + /// /// Search searches for terms or phrases in submitted audio. /// @@ -145,15 +163,6 @@ public class LiveSchema [JsonPropertyName("search")] public List? Search { get; set; } - ///// - ///// Enables sentiment analysis false by default - ///// - //[JsonPropertyName("sentiment")] - //public bool? Sentiment { get; set; } - - //[JsonPropertyName("sentiment_threshold")] - //public double? SentimentThreshold { get; set; } - /// /// Smart Format formats transcripts to improve readability. /// @@ -169,63 +178,6 @@ public class LiveSchema [JsonPropertyName("tag")] public List? Tag { get; set; } - ///// - ///// Level of model you would like to use in your request. - ///// - ///// - //[JsonPropertyName("tier")] - //[Obsolete("Use Model with joint model syntax https://developers.deepgram.com/docs/models-languages-overview")] - //public string? Tier { get; set; } - - /// - /// Version of the model to use. - /// - /// default value is "latest" - /// - [JsonPropertyName("version")] - public string? Version { get; set; } - - /// - /// Channels allows you to specify the number of independent audio channels your submitted audio contains. - /// Used when the Encoding feature is also being used to submit streaming raw audio - /// - /// - [JsonPropertyName("channels")] - public int? Channels { get; set; } - - /// - /// Encoding allows you to specify the expected encoding of your submitted audio. - /// - /// supported encodings - /// - [JsonPropertyName("encoding")] - public string? Encoding { get; set; } - - /// - /// Endpointing returns transcripts when pauses in speech are detected. - /// - /// - [JsonPropertyName("endpointing")] - public string? EndPointing { get; set; } - - /// - /// Interim Results provides preliminary results for streaming audio to solve the need for immediate results combined with high levels of accuracy. - /// - /// - [JsonPropertyName("interim_results")] - public bool? InterimResults { get; set; } - - [JsonPropertyName("numerals")] - [Obsolete("Replaced with SmartFormat")] - public bool? Numerals { get; set; } - /// - /// Sample Rate allows you to specify the sample rate of your submitted audio. - /// - /// only applies when Encoding has a value - /// - [JsonPropertyName("sample_rate")] - public int? SampleRate { get; set; } - /// /// Indicates how long Deepgram will wait to send a {"type": "UtteranceEnd"} message after a word has been transcribed /// @@ -234,9 +186,16 @@ public class LiveSchema public int? UtteranceEnd { get; set; } /// - /// This is achieved through a Voice Activity Detector (VAD), which gauges the tonal nuances of human speech and can better differentiate between silent and non-silent audio. - /// + /// TODO /// [JsonPropertyName("vad_events")] - public bool? DetectSpeechStart { get; set; } + public int? VadEvents { get; set; } + + /// + /// Version of the model to use. + /// + /// default value is "latest" + /// + [JsonPropertyName("version")] + public string? Version { get; set; } } diff --git a/Deepgram/Models/Live/v1/Metadata.cs b/Deepgram/Models/Live/v1/Metadata.cs index 36ec6988..acdc6927 100644 --- a/Deepgram/Models/Live/v1/Metadata.cs +++ b/Deepgram/Models/Live/v1/Metadata.cs @@ -2,28 +2,29 @@ public record MetaData { - [JsonPropertyName("type")] - [JsonConverter(typeof(JsonStringEnumConverter))] - public LiveType Type { get; set; } = LiveType.Metadata; - - [JsonPropertyName("transaction_key")] - public string? TransactionKey { get; set; } - + /// + /// TODO + /// [JsonPropertyName("request_id")] public string? RequestId { get; set; } - [JsonPropertyName("sha256")] - public string? Sha256 { get; set; } - - [JsonPropertyName("created")] - public DateTime? Created { get; set; } - - [JsonPropertyName("duration")] - public double? Duration { get; set; } - - [JsonPropertyName("channels")] - public int? Channels { get; set; } - - [JsonPropertyName("models")] - public IReadOnlyList Models { get; set; } + /// + /// TODO + /// + [JsonPropertyName("model_uuid")] + public string? ModelUUID { get; set; } + + /// + /// IReadonlyDictionary of + /// + [JsonPropertyName("model_info")] + public Dictionary ModelInfo { get; set; } + + /// + /// Deepgram’s Extra Metadata feature allows you to attach arbitrary key-value pairs to your API requests that are attached to the API response for usage in downstream processing. + /// Extra metadata is limited to 2048 characters per key-value pair. + /// + /// + [JsonPropertyName("extra")] + public Dictionary? Extra { get; set; } } diff --git a/Deepgram/Models/Live/v1/MetadataResponse.cs b/Deepgram/Models/Live/v1/MetadataResponse.cs index da60e79f..e3625b04 100644 --- a/Deepgram/Models/Live/v1/MetadataResponse.cs +++ b/Deepgram/Models/Live/v1/MetadataResponse.cs @@ -2,29 +2,66 @@ public record MetadataResponse { - [JsonPropertyName("type")] - [JsonConverter(typeof(JsonStringEnumConverter))] - public LiveType Type { get; set; } = LiveType.Metadata; + /// + /// TODO + /// + [JsonPropertyName("channels")] + public int? Channels { get; set; } - [JsonPropertyName("transaction_key")] - public string? TransactionKey { get; set; } + /// + /// TODO + /// + [JsonPropertyName("created")] + public DateTime? Created { get; set; } + + /// + /// TODO + /// + [JsonPropertyName("duration")] + public double? Duration { get; set; } + + /// + /// TODO + /// + [JsonPropertyName("model_info")] + public IReadOnlyDictionary? ModelInfo { get; set; } + + /// + /// TODO + /// + [JsonPropertyName("models")] + public IReadOnlyList? Models { get; set; } + /// + /// TODO + /// [JsonPropertyName("request_id")] public string? RequestId { get; set; } + /// + /// TODO + /// [JsonPropertyName("sha256")] public string? Sha256 { get; set; } - [JsonPropertyName("created")] - public DateTime? Created { get; set; } - - [JsonPropertyName("duration")] - public double? Duration { get; set; } + /// + /// TODO + /// + [JsonPropertyName("transaction_key")] + public string? TransactionKey { get; set; } - [JsonPropertyName("channels")] - public int? Channels { get; set; } + /// + /// TODO + /// + [JsonPropertyName("type")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public LiveType? Type { get; set; } = LiveType.Metadata; - [JsonPropertyName("models")] - public IReadOnlyList Models { get; set; } - public IReadOnlyDictionary ModelInfo { get; set; } + /// + /// Deepgram’s Extra Metadata feature allows you to attach arbitrary key-value pairs to your API requests that are attached to the API response for usage in downstream processing. + /// Extra metadata is limited to 2048 characters per key-value pair. + /// + /// + [JsonPropertyName("extra")] + public Dictionary? Extra { get; set; } } diff --git a/Deepgram/Models/Live/v1/ModelInfo.cs b/Deepgram/Models/Live/v1/ModelInfo.cs index 4dfb2acc..b0b3adeb 100644 --- a/Deepgram/Models/Live/v1/ModelInfo.cs +++ b/Deepgram/Models/Live/v1/ModelInfo.cs @@ -2,12 +2,21 @@ public record ModelInfo { + /// + /// Architecture of the model + /// + [JsonPropertyName("arch")] + public string? Arch { get; set; } + + /// + /// Name of the model + /// [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Version of the model + /// [JsonPropertyName("version")] public string? Version { get; set; } - - [JsonPropertyName("arch")] - public string? Arch { get; set; } } diff --git a/Deepgram/Models/Live/v1/Search.cs b/Deepgram/Models/Live/v1/Search.cs deleted file mode 100644 index 88c40e32..00000000 --- a/Deepgram/Models/Live/v1/Search.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace Deepgram.Models.Live.v1; - -public record Search -{ - [JsonPropertyName("query")] - public string Query { get; set; } - - /// - /// - /// - [JsonPropertyName("hits")] - public IReadOnlyList Hits { get; set; } -} diff --git a/Deepgram/Models/Live/v1/Segment.cs b/Deepgram/Models/Live/v1/Segment.cs deleted file mode 100644 index a189d668..00000000 --- a/Deepgram/Models/Live/v1/Segment.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace Deepgram.Models.Live.v1; - -public class Segment -{ - [JsonPropertyName("text")] - public string Text { get; set; } - - [JsonPropertyName("start_word")] - public int? StartWord { get; set; } - - [JsonPropertyName("end_word")] - public int? EndWord { get; set; } - - [JsonPropertyName("sentiment")] - public string Sentiment { get; set; } - - [JsonPropertyName("sentiment_score")] - public double? SentimentScore { get; set; } -} diff --git a/Deepgram/Models/Live/v1/SentimentGroup.cs b/Deepgram/Models/Live/v1/SentimentGroup.cs deleted file mode 100644 index 4b4e69e9..00000000 --- a/Deepgram/Models/Live/v1/SentimentGroup.cs +++ /dev/null @@ -1,30 +0,0 @@ -namespace Deepgram.Models.Live.v1; - -public class SentimentGroup -{ - - [JsonPropertyName("sentiment")] - public string Sentiment { get; set; } - - - [JsonPropertyName("sentiment_score")] - public double? SentimentScore { get; set; } - - - [JsonPropertyName("start_time")] - public double? StartTime { get; set; } - - - [JsonPropertyName("end_time")] - public double? EndTime { get; set; } - - - [JsonPropertyName("segments")] - public List Segments { get; } = []; - - - [JsonPropertyName("average")] - public Average Average { get; set; } -} - - diff --git a/Deepgram/Models/Live/v1/SentimentInfo.cs b/Deepgram/Models/Live/v1/SentimentInfo.cs deleted file mode 100644 index e4416389..00000000 --- a/Deepgram/Models/Live/v1/SentimentInfo.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Deepgram.Models.Live.v1; - -public class SentimentInfo -{ - - [JsonPropertyName("model_uuid")] - public string ModelUuid { get; set; } - - - [JsonPropertyName("input_tokens")] - public int? InputTokens { get; set; } - - - [JsonPropertyName("output_tokens")] - public int? OutputTokens { get; set; } -} - - diff --git a/Deepgram/Models/Live/v1/SentimentSegment.cs b/Deepgram/Models/Live/v1/SentimentSegment.cs deleted file mode 100644 index fa6621ff..00000000 --- a/Deepgram/Models/Live/v1/SentimentSegment.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace Deepgram.Models.Live.v1; - -public class SentimentSegment -{ - - [JsonPropertyName("sentiment")] - public string Sentiment { get; set; } - - - [JsonPropertyName("confidence")] - public double? Confidence { get; set; } - - - [JsonPropertyName("text")] - public string Text { get; set; } - - - [JsonPropertyName("start_word")] - public int? StartWord { get; set; } - - - [JsonPropertyName("end_word")] - public int? EndWord { get; set; } -} - - diff --git a/Deepgram/Models/Live/v1/Sentiments.cs b/Deepgram/Models/Live/v1/Sentiments.cs deleted file mode 100644 index 48b31764..00000000 --- a/Deepgram/Models/Live/v1/Sentiments.cs +++ /dev/null @@ -1,30 +0,0 @@ -namespace Deepgram.Models.Live.v1; - -public record Sentiments -{ - - [JsonPropertyName("sentiment")] - public string Sentiment { get; set; } - - - [JsonPropertyName("sentiment_score")] - public double? SentimentScore { get; set; } - - - [JsonPropertyName("start_time")] - public double? StartTime { get; set; } - - - [JsonPropertyName("end_time")] - public double? EndTime { get; set; } - - - [JsonPropertyName("segments")] - public List Segments { get; } = []; - - - [JsonPropertyName("average")] - public Average Average { get; set; } -} - - diff --git a/Deepgram/Models/Live/v1/SpeechstartedResponse.cs b/Deepgram/Models/Live/v1/SpeechstartedResponse.cs new file mode 100644 index 00000000..97a5b89c --- /dev/null +++ b/Deepgram/Models/Live/v1/SpeechstartedResponse.cs @@ -0,0 +1,23 @@ +namespace Deepgram.Models.Live.v1; + +public class SpeechStartedResponse +{ + /// + /// TODO + /// + [JsonPropertyName("type")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public LiveType? Type { get; set; } = LiveType.UtteranceEnd; + + /// + /// TODO + /// + [JsonPropertyName("channel_index")] + public int[]? Channel { get; set; } + + /// + /// TODO + /// + [JsonPropertyName("last_word_end")] + public decimal? Timestamp { get; set; } +} diff --git a/Deepgram/Models/Live/v1/TranscriptionResponse.cs b/Deepgram/Models/Live/v1/TranscriptionResponse.cs index 15a61951..df36bf9b 100644 --- a/Deepgram/Models/Live/v1/TranscriptionResponse.cs +++ b/Deepgram/Models/Live/v1/TranscriptionResponse.cs @@ -1,36 +1,57 @@ namespace Deepgram.Models.Live.v1; public record TranscriptionResponse { - [JsonPropertyName("type")] - [JsonConverter(typeof(JsonStringEnumConverter))] - public LiveType Type { get; set; } = LiveType.Results; + /// + /// TODO + /// + [JsonPropertyName("channel")] + public Channel? Channel { get; set; } + /// + /// TODO + /// [JsonPropertyName("channel_index")] - public IReadOnlyList ChannelIndex { get; set; } + public IReadOnlyList? ChannelIndex { get; set; } + /// + /// TODO + /// [JsonPropertyName("duration")] - public double Duration { get; set; } - - [JsonPropertyName("start")] - public double Start { get; set; } + public double? Duration { get; set; } + /// + /// TODO + /// [JsonPropertyName("is_final")] - public bool IsFinal { get; set; } + public bool? IsFinal { get; set; } - [JsonPropertyName("speech_final")] - public bool SpeechFinal { get; set; } + /// + /// TODO + /// + [JsonPropertyName("metadata")] + public MetaData? MetaData { get; set; } - [JsonPropertyName("channel")] - public Channel Channel { get; set; } + /// + /// TODO + /// + [JsonPropertyName("speech_final")] + public bool? SpeechFinal { get; set; } - [JsonPropertyName("metadata")] - public MetaData MetaData { get; set; } + /// + /// TODO + /// + [JsonPropertyName("start")] + public decimal? Start { get; set; } /// - /// Returns a list text segments and the intents found within each segment. + /// TODO /// - [JsonPropertyName("intents")] - public Intents? Intents { get; set; } + [JsonPropertyName("type")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public LiveType? Type { get; set; } = LiveType.Results; + /// + /// TODO + /// public Exception? Error { get; set; } } diff --git a/Deepgram/Models/Live/v1/UtteranceEndResponse.cs b/Deepgram/Models/Live/v1/UtteranceEndResponse.cs index 5707e3f8..40cf12bd 100644 --- a/Deepgram/Models/Live/v1/UtteranceEndResponse.cs +++ b/Deepgram/Models/Live/v1/UtteranceEndResponse.cs @@ -1,12 +1,23 @@ namespace Deepgram.Models.Live.v1; + public class UtteranceEndResponse { + /// + /// TODO + /// [JsonPropertyName("type")] [JsonConverter(typeof(JsonStringEnumConverter))] - public LiveType Type { get; set; } = LiveType.UtteranceEnd; + public LiveType? Type { get; set; } = LiveType.UtteranceEnd; + + /// + /// TODO + /// [JsonPropertyName("channel_index")] public int[]? Channel { get; set; } + /// + /// TODO + /// [JsonPropertyName("last_word_end")] - public double? LastWordEnd { get; set; } + public decimal? LastWordEnd { get; set; } } diff --git a/Deepgram/Models/Live/v1/Word.cs b/Deepgram/Models/Live/v1/Word.cs index 5b09d7fd..174761e3 100644 --- a/Deepgram/Models/Live/v1/Word.cs +++ b/Deepgram/Models/Live/v1/Word.cs @@ -24,11 +24,17 @@ public record Word /// Value between 0 and 1 indicating the model's relative confidence in this word. /// [JsonPropertyName("confidence")] - public decimal? Confidence { get; set; } + public double? Confidence { get; set; } /// /// Punctuated version of the word /// [JsonPropertyName("punctuated_word")] - public string PunctuatedWord { get; set; } + public string? PunctuatedWord { get; set; } + + /// + /// Speaker index of who said this word + /// + [JsonPropertyName("speaker")] + public int? Speaker { get; set; } }