From e95a19b4c8d349157a69da557df8338416be8520 Mon Sep 17 00:00:00 2001 From: Sandra Rodgers Date: Thu, 29 Jun 2023 14:56:01 -0500 Subject: [PATCH 1/2] adds summarize v2 --- Deepgram/Transcription/PrerecordedTranscriptionOptions.cs | 2 +- Deepgram/Transcription/PrerecordedTranscriptionResult.cs | 6 ++++++ Deepgram/Transcription/Summary.cs | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Deepgram/Transcription/PrerecordedTranscriptionOptions.cs b/Deepgram/Transcription/PrerecordedTranscriptionOptions.cs index 4c89a30c..eb523f7f 100644 --- a/Deepgram/Transcription/PrerecordedTranscriptionOptions.cs +++ b/Deepgram/Transcription/PrerecordedTranscriptionOptions.cs @@ -203,7 +203,7 @@ public class PrerecordedTranscriptionOptions /// Indicates whether Deepgram should provide summarizations of sections of the provided audio. /// [JsonProperty("summarize")] - public Nullable Summarize { get; set; } = null; + public object Summarize { get; set; } = null; /// /// Indicates whether Deepgram should detect entities within the provided audio. diff --git a/Deepgram/Transcription/PrerecordedTranscriptionResult.cs b/Deepgram/Transcription/PrerecordedTranscriptionResult.cs index 8891733e..8b1ffdfa 100644 --- a/Deepgram/Transcription/PrerecordedTranscriptionResult.cs +++ b/Deepgram/Transcription/PrerecordedTranscriptionResult.cs @@ -16,5 +16,11 @@ public class PrerecordedTranscriptionResult /// [JsonProperty("utterances")] public Utterance[] Utterances { get; set; } + + /// + /// Summary of Transcription. + /// + [JsonProperty("summary")] + public Summary Summary { get; set; } } } diff --git a/Deepgram/Transcription/Summary.cs b/Deepgram/Transcription/Summary.cs index 6fc0661d..74b1c8ae 100644 --- a/Deepgram/Transcription/Summary.cs +++ b/Deepgram/Transcription/Summary.cs @@ -23,5 +23,11 @@ public class Summary [JsonProperty("end_word")] public int EndWord { get; set; } + /// + /// Array of Channel objects. + /// + [JsonProperty("short")] + public string Short { get; set; } + } } From 25e73039bf85cf5376036a774fd70bc836eb20d2 Mon Sep 17 00:00:00 2001 From: Sandra Rodgers Date: Thu, 29 Jun 2023 18:22:26 -0500 Subject: [PATCH 2/2] adds NullValueHandling to ignore response null values --- Deepgram/Transcription/PrerecordedTranscriptionResult.cs | 2 +- Deepgram/Transcription/Summary.cs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Deepgram/Transcription/PrerecordedTranscriptionResult.cs b/Deepgram/Transcription/PrerecordedTranscriptionResult.cs index 8b1ffdfa..16faaed1 100644 --- a/Deepgram/Transcription/PrerecordedTranscriptionResult.cs +++ b/Deepgram/Transcription/PrerecordedTranscriptionResult.cs @@ -20,7 +20,7 @@ public class PrerecordedTranscriptionResult /// /// Summary of Transcription. /// - [JsonProperty("summary")] + [JsonProperty("summary", NullValueHandling=NullValueHandling.Ignore)] public Summary Summary { get; set; } } } diff --git a/Deepgram/Transcription/Summary.cs b/Deepgram/Transcription/Summary.cs index 74b1c8ae..7a149e50 100644 --- a/Deepgram/Transcription/Summary.cs +++ b/Deepgram/Transcription/Summary.cs @@ -8,7 +8,7 @@ public class Summary /// /// Summary of a section of the transcript /// - [JsonProperty("summary")] + [JsonProperty("summary", NullValueHandling=NullValueHandling.Ignore)] public string TextSummary { get; set; } /// @@ -26,8 +26,10 @@ public class Summary /// /// Array of Channel objects. /// - [JsonProperty("short")] + [JsonProperty("short", NullValueHandling=NullValueHandling.Ignore)] public string Short { get; set; } } } + +