diff --git a/Deepgram/Models/PreRecorded/v1/Alternative.cs b/Deepgram/Models/PreRecorded/v1/Alternative.cs index e5b5b1c9..12328823 100644 --- a/Deepgram/Models/PreRecorded/v1/Alternative.cs +++ b/Deepgram/Models/PreRecorded/v1/Alternative.cs @@ -2,12 +2,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; } /// /// ReadOnlyList of objects. @@ -22,12 +21,13 @@ public record Alternative /// Only used when the paragraph feature is enabled on the request [JsonPropertyName("paragraphs")] public ParagraphGroup? Paragraphs { get; set; } + /// /// ReadOnly List of objects. /// /// Only used when the summarize feature is enabled on the request [JsonPropertyName("summaries")] - public IReadOnlyList? Summaries { get; set; } + public IReadOnlyList? Summaries { get; set; } /// /// Single-string transcript containing what the model hears in this channel of audio. @@ -43,18 +43,9 @@ public record Alternative [JsonPropertyName("translations")] public IReadOnlyList? Translations { get; set; } - /// - /// Group of Topics - /// - [JsonPropertyName("topics")] - public IReadOnlyList? Topics { get; set; } - /// /// ReadOnly List of objects. /// [JsonPropertyName("words")] public IReadOnlyList? Words { get; set; } - - [JsonPropertyName("sentiment_segments")] - public List? SentimentSegments { get; set; } } diff --git a/Deepgram/Models/PreRecorded/v1/Average.cs b/Deepgram/Models/PreRecorded/v1/Average.cs index 3cbc0768..84a4f16b 100644 --- a/Deepgram/Models/PreRecorded/v1/Average.cs +++ b/Deepgram/Models/PreRecorded/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/PreRecorded/v1/Channel.cs b/Deepgram/Models/PreRecorded/v1/Channel.cs index ae2a5798..1b8483e2 100644 --- a/Deepgram/Models/PreRecorded/v1/Channel.cs +++ b/Deepgram/Models/PreRecorded/v1/Channel.cs @@ -14,7 +14,9 @@ public record Channel [JsonPropertyName("detected_language")] public string? DetectedLanguage { get; set; } - + /// + /// TODO + /// [JsonPropertyName("language_confidence")] public double? LanguageConfidence { get; set; } diff --git a/Deepgram/Models/PreRecorded/v1/Entity.cs b/Deepgram/Models/PreRecorded/v1/Entity.cs index da77e682..715d3a10 100644 --- a/Deepgram/Models/PreRecorded/v1/Entity.cs +++ b/Deepgram/Models/PreRecorded/v1/Entity.cs @@ -31,5 +31,5 @@ public record Entity /// Value between 0 and 1 indicating the model's relative confidence in this detected entity. /// [JsonPropertyName("confidence")] - public decimal? Confidence { get; set; } + public double? Confidence { get; set; } } diff --git a/Deepgram/Models/PreRecorded/v1/Hit.cs b/Deepgram/Models/PreRecorded/v1/Hit.cs index 47fb7f1d..cf7bf3d7 100644 --- a/Deepgram/Models/PreRecorded/v1/Hit.cs +++ b/Deepgram/Models/PreRecorded/v1/Hit.cs @@ -6,25 +6,24 @@ public record Hit /// Value between 0 and 1 that indicates the model's relative confidence in this hit. /// [JsonPropertyName("confidence")] - public decimal Confidence { get; set; } + public double? Confidence { get; set; } /// /// Offset in seconds from the start of the audio to where the hit ends. /// [JsonPropertyName("end")] - public decimal End { get; set; } + public decimal? End { get; set; } /// /// Transcript that corresponds to the time between start and end. /// [JsonPropertyName("snippet")] - public string Snippet { get; set; } + public string? Snippet { get; set; } /// /// Offset in seconds from the start of the audio to where the hit occurs. /// [JsonPropertyName("start")] - public decimal Start { get; set; } - + public decimal? Start { get; set; } } diff --git a/Deepgram/Models/PreRecorded/v1/Intent.cs b/Deepgram/Models/PreRecorded/v1/Intent.cs index af0dedc6..86ace49f 100644 --- a/Deepgram/Models/PreRecorded/v1/Intent.cs +++ b/Deepgram/Models/PreRecorded/v1/Intent.cs @@ -6,12 +6,13 @@ public record Intent /// /// [JsonPropertyName("intent")] - public string Intention { get; set; } + public string? Intention { get; set; } + /// /// /// [JsonPropertyName("confidence_score")] - public double ConfidenceScore { get; set; } + public double? ConfidenceScore { get; set; } } diff --git a/Deepgram/Models/PreRecorded/v1/Intents.cs b/Deepgram/Models/PreRecorded/v1/IntentGroup.cs similarity index 92% rename from Deepgram/Models/PreRecorded/v1/Intents.cs rename to Deepgram/Models/PreRecorded/v1/IntentGroup.cs index 2d53d17c..8b981301 100644 --- a/Deepgram/Models/PreRecorded/v1/Intents.cs +++ b/Deepgram/Models/PreRecorded/v1/IntentGroup.cs @@ -1,5 +1,6 @@ namespace Deepgram.Models.PreRecorded.v1; -public record Intents + +public record IntentGroup { /// /// @@ -7,5 +8,4 @@ public record Intents /// [JsonPropertyName("segments")] public IReadOnlyList? Segments { get; set; } - } diff --git a/Deepgram/Models/PreRecorded/v1/IntentSchema.cs b/Deepgram/Models/PreRecorded/v1/IntentSchema.cs index fa426a14..cb0c4afb 100644 --- a/Deepgram/Models/PreRecorded/v1/IntentSchema.cs +++ b/Deepgram/Models/PreRecorded/v1/IntentSchema.cs @@ -11,17 +11,17 @@ public class IntentSchema /// The language of your input audio (Only english is supported at this time) /// [JsonPropertyName("language")] - public string Language { get; set; } = "en"; + public string? Language { get; set; } = "en"; /// /// 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; } + 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; } + public string? CustomIntentMode { get; set; } } diff --git a/Deepgram/Models/PreRecorded/v1/IntentSegment.cs b/Deepgram/Models/PreRecorded/v1/IntentSegment.cs index 2f64ab59..3650b1d5 100644 --- a/Deepgram/Models/PreRecorded/v1/IntentSegment.cs +++ b/Deepgram/Models/PreRecorded/v1/IntentSegment.cs @@ -6,24 +6,24 @@ public record IntentSegment /// /// [JsonPropertyName("text")] - public string Text { get; set; } + public string? Text { get; set; } /// /// /// [JsonPropertyName("start_word")] - public int StartWord { get; set; } + public int? StartWord { get; set; } /// /// /// [JsonPropertyName("end_word")] - public int EndWord { get; set; } + public int? EndWord { get; set; } /// /// /// /// [JsonPropertyName("intents")] - public IReadOnlyList Intents { get; set; } + public IReadOnlyList? Intents { get; set; } } diff --git a/Deepgram/Models/PreRecorded/v1/IntentsInfo.cs b/Deepgram/Models/PreRecorded/v1/IntentsInfo.cs index 19ce351d..86c065a4 100644 --- a/Deepgram/Models/PreRecorded/v1/IntentsInfo.cs +++ b/Deepgram/Models/PreRecorded/v1/IntentsInfo.cs @@ -2,15 +2,21 @@ public record IntentsInfo { - - [JsonPropertyName("model_uuid")] - public string ModelUuid { get; set; } - - + /// + /// TODO + /// [JsonPropertyName("input_tokens")] public int? InputTokens { get; set; } + /// + /// TODO + /// + [JsonPropertyName("model_uuid")] + public string? ModelUuid { get; set; } + /// + /// TODO + /// [JsonPropertyName("output_tokens")] public int? OutputTokens { get; set; } } diff --git a/Deepgram/Models/PreRecorded/v1/Metadata.cs b/Deepgram/Models/PreRecorded/v1/Metadata.cs index f3216ffe..b32f708a 100644 --- a/Deepgram/Models/PreRecorded/v1/Metadata.cs +++ b/Deepgram/Models/PreRecorded/v1/Metadata.cs @@ -1,6 +1,11 @@ namespace Deepgram.Models.PreRecorded.v1; public record Metadata { + /// + /// Number of channels detected in the submitted audio. + /// + [JsonPropertyName("channels")] + public int? Channels { get; set; } /// /// Timestamp that indicates when the audio was submitted. @@ -8,25 +13,35 @@ public record Metadata [JsonPropertyName("created")] public DateTime? Created { get; set; } - /// - /// Number of channels detected in the submitted audio. - /// - [JsonPropertyName("channels")] - public int? Channels { get; set; } - /// /// Duration in seconds of the submitted audio. /// [JsonPropertyName("duration")] public double? Duration { 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; } + + /// + /// TODO + /// + [JsonPropertyName("intents_info")] + public IntentsInfo? IntentsInfo { get; set; } + /// /// IReadonlyDictionary of /// [JsonPropertyName("model_info")] - public Dictionary ModelInfo { get; set; } - + public Dictionary? ModelInfo { get; set; } + /// + /// TODO + /// [JsonPropertyName("models")] public List? Models { get; set; } @@ -36,6 +51,12 @@ public record Metadata [JsonPropertyName("request_id")] public string? RequestId { get; set; } + /// + /// TODO. + /// + [JsonPropertyName("sentiment_info")] + public SentimentInfo? SentimentInfo { get; set; } + /// /// SHA-256 hash of the submitted audio data. /// @@ -43,9 +64,16 @@ public record Metadata public string? Sha256 { get; set; } /// - /// Tags relating to the project + /// TODO /// - public List? Tags { get; set; } + [JsonPropertyName("summary_info")] + public SummaryInfo? SummaryInfo { get; set; } + + /// + /// TODO + /// + [JsonPropertyName("topics_info")] + public TopicsInfo? TopicsInfo { get; set; } /// /// Blob of text that helps Deepgram engineers debug any problems you encounter. @@ -54,17 +82,9 @@ public record Metadata [Obsolete("phasing out")] public string? TransactionKey { get; set; } - [JsonPropertyName("sentiment_info")] - public SentimentInfo SentimentInfo { get; set; } - - [JsonPropertyName("intents_info")] - public IntentsInfo IntentsInfo { get; set; } - /// /// Warnings to provide feedback about unsupported and deprecated queries. /// [JsonPropertyName("warnings")] public List? Warnings { get; set; } - - } diff --git a/Deepgram/Models/PreRecorded/v1/ModelInfo.cs b/Deepgram/Models/PreRecorded/v1/ModelInfo.cs index 1f58505e..6b70b3c6 100644 --- a/Deepgram/Models/PreRecorded/v1/ModelInfo.cs +++ b/Deepgram/Models/PreRecorded/v1/ModelInfo.cs @@ -2,12 +2,21 @@ public record ModelInfo { + /// + /// TODO + /// + [JsonPropertyName("arch")] + public string? Arch { get; set; } + + /// + /// TODO + /// [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// TODO + /// [JsonPropertyName("version")] public string? Version { get; set; } - - [JsonPropertyName("arch")] - public string? Arch { get; set; } } diff --git a/Deepgram/Models/PreRecorded/v1/Paragraph.cs b/Deepgram/Models/PreRecorded/v1/Paragraph.cs index f827baf1..9d526820 100644 --- a/Deepgram/Models/PreRecorded/v1/Paragraph.cs +++ b/Deepgram/Models/PreRecorded/v1/Paragraph.cs @@ -2,14 +2,11 @@ public record Paragraph { - [JsonPropertyName("channel")] - public int? Channel { get; set; } - /// - /// Offset in seconds from the start of the audio to where the paragraph ends. + /// ReadOnly of Sentence objects. /// - [JsonPropertyName("end")] - public decimal? End { get; set; } + [JsonPropertyName("sentences")] + public IReadOnlyList? Sentences { get; set; } /// /// Number of words in the paragraph @@ -17,26 +14,28 @@ public record Paragraph [JsonPropertyName("num_words")] internal int? NumWords { get; set; } - [JsonPropertyName("paragraphs")] - public IReadOnlyList? Paragraphs { get; set; } - /// - /// ReadOnly of Sentence objects. - /// - [JsonPropertyName("sentences")] - public IReadOnlyList? Sentences { get; set; } - - [JsonPropertyName("transcript")] - public string Transcript { get; set; } - - [JsonPropertyName("sentiments")] - public List Sentiments; - /// /// Offset in seconds from the start of the audio to where the paragraph starts. /// [JsonPropertyName("start")] public decimal? Start { get; set; } + /// + /// Offset in seconds from the start of the audio to where the paragraph ends. + /// + [JsonPropertyName("end")] + public decimal? End { get; set; } + + /// + /// TODO + /// + [JsonPropertyName("sentiment")] + public string? Sentiment { get; set; } + /// + /// TODO + /// + [JsonPropertyName("sentiment_score")] + public double? SentimentScore { get; set; } } diff --git a/Deepgram/Models/PreRecorded/v1/PrerecordedSchema.cs b/Deepgram/Models/PreRecorded/v1/PrerecordedSchema.cs index 8a728762..54716c79 100644 --- a/Deepgram/Models/PreRecorded/v1/PrerecordedSchema.cs +++ b/Deepgram/Models/PreRecorded/v1/PrerecordedSchema.cs @@ -2,7 +2,6 @@ public class PrerecordedSchema { - /// /// Number of transcripts to return per request /// @@ -25,18 +24,49 @@ public class PrerecordedSchema [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. A custom intent you want the model to detect within your input audio if present. Submit up to 100. + /// + [JsonPropertyName("custom_intent")] + public List? 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; } + /// + /// 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; } + + /// + /// TODO + /// + [JsonPropertyName("custom_topic")] + public List? CustomTopic { get; set; } + + /// + /// TODO + /// + [JsonPropertyName("custom_topic_mode")] + public string? CustomTopicMode { get; set; } + /// + /// Entity Detection identifies and extracts key entities from content in submitted audio + /// + /// + [JsonPropertyName("detect_entities")] + public bool? DetectEntities { get; set; } + + /// + /// Language Detection identifies the dominant language spoken in submitted audio. + /// + /// + [JsonPropertyName("detect_language")] + public bool? DetectLanguage { get; set; } + + /// + /// TODO + /// + [JsonPropertyName("detect_topics")] + public bool? DetectTopics { get; set; } /// /// Diarize recognizes speaker changes and assigns a speaker to each word in the transcript. @@ -53,14 +83,20 @@ public class PrerecordedSchema [JsonPropertyName("diarize_version")] public string? DiarizeVersion { get; set; } + // + /// + /// default is null, only applies if Diarize is set to true + /// + [JsonPropertyName("dictation")] + public bool? Dictation { 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 +105,11 @@ public class PrerecordedSchema [JsonPropertyName("filler_words")] public bool? FillerWords { get; set; } - ///// - ///// Enables intent recognition - ///// - //[JsonPropertyName("intents")] - //public bool? Intents { get; set; } + /// + /// TODO + /// + [JsonPropertyName("intents")] + public bool? Intents { get; set; } /// /// Keywords can boost or suppress specialized terminology. @@ -90,6 +126,12 @@ public class PrerecordedSchema [JsonPropertyName("language")] public string? Language { get; set; } + /// + /// TODO + /// + [JsonPropertyName("measurements")] + public bool? Measurements { get; set; } + /// /// AI model used to process submitted audio /// @@ -104,12 +146,16 @@ public class PrerecordedSchema [JsonPropertyName("multichannel")] public bool? MultiChannel { get; set; } + /// + /// TODO + /// + [JsonPropertyName("paragraphs")] + public bool? Paragraphs { get; set; } /// /// Profanity Filter looks for recognized profanity and converts it to the nearest recognized /// non-profane word or removes it from the transcript completely. /// - /// for use with base model tier only /// [JsonPropertyName("profanity_filter")] public bool? ProfanityFilter { get; set; } @@ -145,14 +191,11 @@ public class PrerecordedSchema [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; } + /// + /// TODO + /// + [JsonPropertyName("sentiment")] + public bool? Sentiment { get; set; } /// /// Smart Format formats transcripts to improve readability. @@ -161,6 +204,13 @@ public class PrerecordedSchema [JsonPropertyName("smart_format")] public bool? SmartFormat { get; set; } + ///// + ///// TODO + ///// + [JsonPropertyName("summarize")] + public string? Summarize { get; set; } + + /// /// Tagging allows you to label your requests with one or more tags in a list,for the purpose of identification during usage reporting. /// @@ -170,92 +220,28 @@ public class PrerecordedSchema public List? Tag { get; set; } ///// - ///// Level of model you would like to use in your request. - ///// + ///// TODO ///// - //[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; } - - /// - /// Entity Detection identifies and extracts key entities from content in submitted audio - /// - /// - [JsonPropertyName("detect_entities")] - public bool? DetectEntities { get; set; } - - /// - /// Language Detection identifies the dominant language spoken in submitted audio. - /// - /// - [JsonPropertyName("detect_language")] - public bool? DetectLanguage { get; set; } - - /// - /// Topic Detection identifies and extracts key topics from content in submitted audio. - /// - /// Default is false - /// - [JsonPropertyName("detect_topics")] - public bool? DetectTopics { get; set; } - - /// - /// Spoken dictation commands will be converted to their corresponding punctuation marks. e.g., comma to , - /// - /// Default is false - /// - [JsonPropertyName("dictation")] - public bool? Dictation { get; set; } - - /// - /// Spoken measurements will be converted to their corresponding abbreviations. e.g., milligram to mg - /// Default is false - /// - [JsonPropertyName("measurements")] - public bool? Measurements { get; set; } - - [JsonPropertyName("ner")] - [Obsolete("Replaced with SmartFormat")] - public bool? Ner { get; set; } - - /// - /// Paragraphs splits audio into paragraphs to improve transcript readability. - /// - /// - [JsonPropertyName("paragraphs")] - public bool? Paragraphs { get; set; } + [JsonPropertyName("topics")] + public bool? Topics { get; set; } /// - /// Summarizes content of submitted audio. - /// - /// Default is v2 + /// TODO /// - [JsonPropertyName("summarize")] - public object? Summarize { get; set; } + [JsonPropertyName("utt_split")] + public double? UttSplit { get; set; } /// - /// Utterances segments speech into meaningful semantic units. - /// - /// default is false + /// TODO /// [JsonPropertyName("utterances")] public bool? Utterances { get; set; } /// - /// Utterance Split detects pauses between words in submitted audio. - /// Used when the Utterances feature is enabled for pre-recorded audio. - /// - /// Default is 0.8 + /// Version of the model to use. + /// + /// default value is "latest" /// - [JsonPropertyName("utt_split")] - public double? UttSplit { get; set; } - + [JsonPropertyName("version")] + public string? Version { get; set; } } diff --git a/Deepgram/Models/PreRecorded/v1/Results.cs b/Deepgram/Models/PreRecorded/v1/Results.cs index d9137f23..038e0afe 100644 --- a/Deepgram/Models/PreRecorded/v1/Results.cs +++ b/Deepgram/Models/PreRecorded/v1/Results.cs @@ -8,26 +8,34 @@ public record Results [JsonPropertyName("channels")] public IReadOnlyList? Channels { get; set; } + /// + /// TODO + /// [JsonPropertyName("intents")] - public Intents Intents { get; set; } - + public IntentGroup? Intents { get; set; } - [JsonPropertyName("paragraphs")] - public ParagraphGroup? ParagraphGroup { get; set; } + /// + /// TODO + /// + [JsonPropertyName("sentiments")] + public SentimentGroup? Sentiments { get; set; } /// /// Transcription Summary /// [JsonPropertyName("summary")] - public TranscriptionSummary? Summary { get; set; } + public Summary? Summary { get; set; } + + /// + /// TODO + /// + [JsonPropertyName("topics")] + public TopicGroup? Topics { get; set; } /// /// ReadOnlyList of /// [JsonPropertyName("utterances")] public IReadOnlyList? Utterances { get; set; } - - [JsonPropertyName("sentiments")] - public Sentiments Sentiments { get; set; } } diff --git a/Deepgram/Models/PreRecorded/v1/Segment.cs b/Deepgram/Models/PreRecorded/v1/Segment.cs index d91a2f18..b68be724 100644 --- a/Deepgram/Models/PreRecorded/v1/Segment.cs +++ b/Deepgram/Models/PreRecorded/v1/Segment.cs @@ -2,18 +2,45 @@ public class Segment { + /// + /// TODO + /// [JsonPropertyName("text")] - public string Text { get; set; } + public string? Text { get; set; } + /// + /// TODO + /// [JsonPropertyName("start_word")] public int? StartWord { get; set; } + /// + /// TODO + /// [JsonPropertyName("end_word")] public int? EndWord { get; set; } + /// + /// TODO + /// [JsonPropertyName("sentiment")] - public string Sentiment { get; set; } + public string? Sentiment { get; set; } + /// + /// TODO + /// [JsonPropertyName("sentiment_score")] public double? SentimentScore { get; set; } + + /// + /// TODO + /// + [JsonPropertyName("topics")] + public IReadOnlyList? Topics { get; set; } + + /// + /// TODO + /// + [JsonPropertyName("intents")] + public IReadOnlyList? Intents { get; set; } } diff --git a/Deepgram/Models/PreRecorded/v1/Sentence.cs b/Deepgram/Models/PreRecorded/v1/Sentence.cs index f2dc471a..7b2eb851 100644 --- a/Deepgram/Models/PreRecorded/v1/Sentence.cs +++ b/Deepgram/Models/PreRecorded/v1/Sentence.cs @@ -20,7 +20,16 @@ public record Sentence [JsonPropertyName("end")] public decimal? End { get; set; } - [JsonPropertyName("sentiments")] - public List Sentiments; + /// + /// TODO + /// + [JsonPropertyName("sentiment")] + public string? Sentiment { get; set; } + + /// + /// TODO + /// + [JsonPropertyName("sentiment_score")] + public double? SentimentScore { get; set; } } diff --git a/Deepgram/Models/PreRecorded/v1/SentimentGroup.cs b/Deepgram/Models/PreRecorded/v1/SentimentGroup.cs index 5d468ddf..5e33501d 100644 --- a/Deepgram/Models/PreRecorded/v1/SentimentGroup.cs +++ b/Deepgram/Models/PreRecorded/v1/SentimentGroup.cs @@ -2,29 +2,17 @@ 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; } - - + /// + /// TODO + /// [JsonPropertyName("segments")] - public List Segments { get; } = []; - + public IReadOnlyList? Segments { get; set; } + /// + /// TODO + /// [JsonPropertyName("average")] - public Average Average { get; set; } + public Average? Average { get; set; } } diff --git a/Deepgram/Models/PreRecorded/v1/SentimentInfo.cs b/Deepgram/Models/PreRecorded/v1/SentimentInfo.cs index 96ee7301..3423812c 100644 --- a/Deepgram/Models/PreRecorded/v1/SentimentInfo.cs +++ b/Deepgram/Models/PreRecorded/v1/SentimentInfo.cs @@ -2,15 +2,21 @@ public class SentimentInfo { - - [JsonPropertyName("model_uuid")] - public string ModelUuid { get; set; } - - + /// + /// TODO + /// [JsonPropertyName("input_tokens")] public int? InputTokens { get; set; } + /// + /// TODO + /// + [JsonPropertyName("model_uuid")] + public string? ModelUuid { get; set; } + /// + /// TODO + /// [JsonPropertyName("output_tokens")] public int? OutputTokens { get; set; } } diff --git a/Deepgram/Models/PreRecorded/v1/SentimentSegment.cs b/Deepgram/Models/PreRecorded/v1/SentimentSegment.cs deleted file mode 100644 index 525f3ca7..00000000 --- a/Deepgram/Models/PreRecorded/v1/SentimentSegment.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace Deepgram.Models.PreRecorded.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/PreRecorded/v1/Sentiments.cs b/Deepgram/Models/PreRecorded/v1/Sentiments.cs deleted file mode 100644 index cfaf7b33..00000000 --- a/Deepgram/Models/PreRecorded/v1/Sentiments.cs +++ /dev/null @@ -1,30 +0,0 @@ -namespace Deepgram.Models.PreRecorded.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/PreRecorded/v1/Summary.cs b/Deepgram/Models/PreRecorded/v1/Summary.cs index 38c41446..07c75e87 100644 --- a/Deepgram/Models/PreRecorded/v1/Summary.cs +++ b/Deepgram/Models/PreRecorded/v1/Summary.cs @@ -1,21 +1,17 @@ namespace Deepgram.Models.PreRecorded.v1; -public record Summary +public record Summary // aka SummaryV2 { /// /// Summary of a section of the transcript /// - [JsonPropertyName("summary")] - public string? Text { get; set; } + [JsonPropertyName("short")] + public string? Short { get; set; } + /// /// Word position in transcript where the summary begins /// - [JsonPropertyName("start_word")] - public int? StartWord { get; set; } - /// - /// Word position in transcript where the summary ends - /// - [JsonPropertyName("end_word")] - public int? EndWord { get; set; } + [JsonPropertyName("result")] + public string? Result { get; set; } } diff --git a/Deepgram/Models/PreRecorded/v1/SummaryInfo.cs b/Deepgram/Models/PreRecorded/v1/SummaryInfo.cs new file mode 100644 index 00000000..fd013030 --- /dev/null +++ b/Deepgram/Models/PreRecorded/v1/SummaryInfo.cs @@ -0,0 +1,22 @@ +namespace Deepgram.Models.PreRecorded.v1; + +public record SummaryInfo +{ + /// + /// TODO + /// + [JsonPropertyName("input_tokens")] + public int? InputTokens { get; set; } + + /// + /// TODO + /// + [JsonPropertyName("model_uuid")] + public string? ModelUUID { get; set; } + + /// + /// TODO + /// + [JsonPropertyName("output_tokens")] + public int? OutputTokens { get; set; } +} diff --git a/Deepgram/Models/PreRecorded/v1/SummaryObsolete.cs b/Deepgram/Models/PreRecorded/v1/SummaryObsolete.cs new file mode 100644 index 00000000..06ec58c5 --- /dev/null +++ b/Deepgram/Models/PreRecorded/v1/SummaryObsolete.cs @@ -0,0 +1,21 @@ +namespace Deepgram.Models.PreRecorded.v1; + +public record SummaryObsolete // aka SummaryV1 +{ + /// + /// Summary of a section of the transcript + /// + [JsonPropertyName("summary")] + public string? Text { get; set; } + /// + /// Word position in transcript where the summary begins + /// + [JsonPropertyName("start_word")] + public int? StartWord { get; set; } + /// + /// Word position in transcript where the summary ends + /// + [JsonPropertyName("end_word")] + public int? EndWord { get; set; } +} + diff --git a/Deepgram/Models/PreRecorded/v1/SyncResponse.cs b/Deepgram/Models/PreRecorded/v1/SyncResponse.cs index 7fc295e9..04486aea 100644 --- a/Deepgram/Models/PreRecorded/v1/SyncResponse.cs +++ b/Deepgram/Models/PreRecorded/v1/SyncResponse.cs @@ -14,20 +14,12 @@ public record SyncResponse [JsonPropertyName("results")] public Results? Results { get; set; } - /// - /// Returns a list text segments and the intents found within each segment. - /// - [JsonPropertyName("intents")] - public Intents? Intents { get; set; } - - - public string ToWebVTT() { if (Results == null || Results.Utterances == null) { throw new Exception( - "This method requires a transcript that was generated with the utterances feature." + "This method requires a transcript that was generated with the utterances feature." ); } @@ -55,7 +47,7 @@ public string ToSRT() if (Results == null || Results.Utterances == null) { throw new Exception( - "This method requires a transcript that was generated with the utterances feature." + "This method requires a transcript that was generated with the utterances feature." ); } @@ -73,6 +65,6 @@ public string ToSRT() return srt; } - private static string SecondsToTimestamp(decimal seconds) => - new TimeSpan((long)(seconds * 10000000)).ToString().Substring(0, seconds % 1 == 0 ? 8 : 12); + private static string SecondsToTimestamp(decimal? seconds) => + new TimeSpan((long)(seconds??0 * 10000000)).ToString().Substring(0, seconds % 1 == 0 ? 8 : 12); } diff --git a/Deepgram/Models/PreRecorded/v1/Topic.cs b/Deepgram/Models/PreRecorded/v1/Topic.cs index f69b49f8..86d7925b 100644 --- a/Deepgram/Models/PreRecorded/v1/Topic.cs +++ b/Deepgram/Models/PreRecorded/v1/Topic.cs @@ -6,24 +6,12 @@ public class Topic /// Value between 0 and 1 indicating the model's relative confidence in this topic. /// [JsonPropertyName("confidence")] - public decimal? Confidence { get; set; } - - [JsonPropertyName("end_word")] - public int? EndWord; + public double? Confidence { get; set; } /// - /// Topic detected. + /// TODO /// [JsonPropertyName("topic")] - public string? Name { get; set; } - - [JsonPropertyName("start_word")] - public int? StartWord; - - [JsonPropertyName("text")] public string Text; - - [JsonPropertyName("topics")] - public List Topics; } diff --git a/Deepgram/Models/PreRecorded/v1/TopicGroup.cs b/Deepgram/Models/PreRecorded/v1/TopicGroup.cs index eb71e678..2c9e376c 100644 --- a/Deepgram/Models/PreRecorded/v1/TopicGroup.cs +++ b/Deepgram/Models/PreRecorded/v1/TopicGroup.cs @@ -3,27 +3,9 @@ public record TopicGroup { /// - /// ReadonlyList of + /// TODO /// - [JsonPropertyName("topics")] - public IReadOnlyList? Topics { get; set; } - - /// - /// Transcript covered by the topic. - /// - [JsonPropertyName("text")] - public string Text { get; set; } - - /// - /// Word position in transcript where the topic begins - /// - [JsonPropertyName("start_word")] - public int StartWord { get; set; } - - /// - /// Word position in transcript where the topic ends - /// - [JsonPropertyName("end_word")] - public int EndWord { get; set; } + [JsonPropertyName("segments")] + public IReadOnlyList? Segments { get; set; } } diff --git a/Deepgram/Models/PreRecorded/v1/TopicsInfo.cs b/Deepgram/Models/PreRecorded/v1/TopicsInfo.cs new file mode 100644 index 00000000..76d3edad --- /dev/null +++ b/Deepgram/Models/PreRecorded/v1/TopicsInfo.cs @@ -0,0 +1,24 @@ +namespace Deepgram.Models.PreRecorded.v1; + +public record TopicsInfo +{ + /// + /// TODO + /// + [JsonPropertyName("input_tokens")] + public int? InputTokens { get; set; } + + /// + /// TODO + /// + [JsonPropertyName("model_uuid")] + public string? ModelUuid { get; set; } + + /// + /// TODO + /// + [JsonPropertyName("output_tokens")] + public int? OutputTokens { get; set; } +} + + diff --git a/Deepgram/Models/PreRecorded/v1/TranscriptionSummary.cs b/Deepgram/Models/PreRecorded/v1/TranscriptionSummary.cs deleted file mode 100644 index 7fa99bac..00000000 --- a/Deepgram/Models/PreRecorded/v1/TranscriptionSummary.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Deepgram.Models.PreRecorded.v1; - -public record TranscriptionSummary -{ - [JsonPropertyName("result")] - public string? Result { get; set; } - - [JsonPropertyName("short")] - public string? Short { get; set; } -} - diff --git a/Deepgram/Models/PreRecorded/v1/Utterance.cs b/Deepgram/Models/PreRecorded/v1/Utterance.cs index 6d2a2096..1be77d65 100644 --- a/Deepgram/Models/PreRecorded/v1/Utterance.cs +++ b/Deepgram/Models/PreRecorded/v1/Utterance.cs @@ -2,23 +2,23 @@ public record Utterance { - /// - /// Value between 0 and 1 indicating the model's relative confidence in this word. - /// - [JsonPropertyName("confidence")] - public decimal? Confidence { get; set; } - /// /// Audio channel to which the utterance belongs. /// [JsonPropertyName("channel")] public int? Channel { get; set; } + /// + /// Value between 0 and 1 indicating the model's relative confidence in this word. + /// + [JsonPropertyName("confidence")] + public double? Confidence { get; set; } + /// /// Offset in seconds from the start of the audio to where the spoken word ends. /// [JsonPropertyName("end")] - public decimal End { get; set; } + public decimal? End { get; set; } /// /// Unique identifier of the utterance @@ -26,8 +26,17 @@ public record Utterance [JsonPropertyName("id")] public string? Id { get; set; } - [JsonPropertyName("sentiments")] - public List Sentiments; + /// + /// TODO + /// + [JsonPropertyName("sentiment")] + public string? Sentiment { get; set; } + + /// + /// TODO + /// + [JsonPropertyName("sentiment_score")] + public double? SentimentScore { get; set; } /// /// Integer indicating the speaker who is saying the word being processed. @@ -39,7 +48,7 @@ public record Utterance /// Offset in seconds from the start of the audio to where the spoken word starts. /// [JsonPropertyName("start")] - public decimal Start { get; set; } + public decimal? Start { get; set; } /// /// Transcript for the audio segment being processed. @@ -53,6 +62,6 @@ public record Utterance /// /// [JsonPropertyName("words")] - public List Words { get; set; } + public List? Words { get; set; } } diff --git a/Deepgram/Models/PreRecorded/v1/Warning.cs b/Deepgram/Models/PreRecorded/v1/Warning.cs index f0e66499..e22b3013 100644 --- a/Deepgram/Models/PreRecorded/v1/Warning.cs +++ b/Deepgram/Models/PreRecorded/v1/Warning.cs @@ -6,19 +6,19 @@ public record Warning /// Parameter sent in the request that resulted in the warning /// [JsonPropertyName("parameter")] - public string Parameter { get; set; } + public string? Parameter { get; set; } /// /// The type of warning /// [JsonPropertyName("type")] [JsonConverter(typeof(JsonStringEnumConverter))] - public WarningType Type { get; set; } + public WarningType? Type { get; set; } /// /// The warning message /// [JsonPropertyName("message")] - public string Message { get; set; } + public string? Message { get; set; } } diff --git a/Deepgram/Models/PreRecorded/v1/Word.cs b/Deepgram/Models/PreRecorded/v1/Word.cs index c6a8dd56..7897ba0a 100644 --- a/Deepgram/Models/PreRecorded/v1/Word.cs +++ b/Deepgram/Models/PreRecorded/v1/Word.cs @@ -3,16 +3,11 @@ public record Word { /// - /// Distinct word heard by the model. + /// Value between 0 and 1 indicating the model's relative confidence in this word. /// - [JsonPropertyName("word")] - public string HeardWord { get; set; } = string.Empty; - /// - /// Offset in seconds from the start of the audio to where the spoken word starts. - /// - [JsonPropertyName("start")] - public decimal Start { get; set; } + [JsonPropertyName("confidence")] + public double? Confidence { get; set; } /// /// Offset in seconds from the start of the audio to where the spoken word ends. @@ -21,16 +16,22 @@ public record Word public decimal? End { get; set; } /// - /// Value between 0 and 1 indicating the model's relative confidence in this word. + /// Punctuated version of the word /// - [JsonPropertyName("confidence")] - public decimal? Confidence { get; set; } + [JsonPropertyName("punctuated_word")] + public string? PunctuatedWord { get; set; } /// /// Punctuated version of the word /// - [JsonPropertyName("punctuated_word")] - public string? PunctuatedWord { get; set; } + [JsonPropertyName("sentiment")] + public string? Sentiment { get; set; } + + /// + /// Punctuated version of the word + /// + [JsonPropertyName("sentiment_score")] + public double? SentimentScore { get; set; } /// /// Integer indicating the speaker who is saying the word being processed. @@ -42,12 +43,18 @@ public record Word /// Value between 0 and 1 indicating the model's relative confidence in its choice of speaker. /// [JsonPropertyName("speaker_confidence")] - public decimal? SpeakerConfidence { get; set; } + public double? SpeakerConfidence { get; set; } - [JsonPropertyName("sentiment")] - public string Sentiment; + /// + /// Offset in seconds from the start of the audio to where the spoken word starts. + /// + [JsonPropertyName("start")] + public decimal? Start { get; set; } - [JsonPropertyName("sentiment_score")] - public double? SentimentScore; + /// + /// Distinct word heard by the model. + /// + [JsonPropertyName("word")] + public string? HeardWord { get; set; } }