Skip to content

Commit

Permalink
Audit of PreRecorded Model Classes
Browse files Browse the repository at this point in the history
  • Loading branch information
dvonthenen committed Feb 4, 2024
1 parent f34d01a commit 7839332
Show file tree
Hide file tree
Showing 29 changed files with 383 additions and 356 deletions.
15 changes: 3 additions & 12 deletions Deepgram/Models/PreRecorded/v1/Alternative.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

public record Alternative
{

/// <summary>
/// Value between 0 and 1 indicating the model's relative confidence in this transcript.
/// </summary>
[JsonPropertyName("confidence")]
public decimal? Confidence { get; set; }
public double? Confidence { get; set; }

/// <summary>
/// ReadOnlyList of <see cref="Entity"/> objects.
Expand All @@ -22,12 +21,13 @@ public record Alternative
/// <remark>Only used when the paragraph feature is enabled on the request</remark>
[JsonPropertyName("paragraphs")]
public ParagraphGroup? Paragraphs { get; set; }

/// <summary>
/// ReadOnly List of <see cref="Summary "/> objects.
/// </summary>
/// <remark>Only used when the summarize feature is enabled on the request</remark>
[JsonPropertyName("summaries")]
public IReadOnlyList<Summary>? Summaries { get; set; }
public IReadOnlyList<SummaryObsolete>? Summaries { get; set; }

/// <summary>
/// Single-string transcript containing what the model hears in this channel of audio.
Expand All @@ -43,18 +43,9 @@ public record Alternative
[JsonPropertyName("translations")]
public IReadOnlyList<Translation>? Translations { get; set; }

/// <summary>
/// Group of Topics<see cref="TopicGroup"/>
/// </summary>
[JsonPropertyName("topics")]
public IReadOnlyList<TopicGroup>? Topics { get; set; }

/// <summary>
/// ReadOnly List of <see cref="Word"/> objects.
/// </summary>
[JsonPropertyName("words")]
public IReadOnlyList<Word>? Words { get; set; }

[JsonPropertyName("sentiment_segments")]
public List<SentimentSegment>? SentimentSegments { get; set; }
}
6 changes: 6 additions & 0 deletions Deepgram/Models/PreRecorded/v1/Average.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@

public class Average
{
/// <summary>
/// TODO
/// </summary>
[JsonPropertyName("sentiment")]
public string? Sentiment { get; set; }

/// <summary>
/// TODO
/// </summary>
[JsonPropertyName("sentiment_score")]
public double? SentimentScore { get; set; }
}
4 changes: 3 additions & 1 deletion Deepgram/Models/PreRecorded/v1/Channel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ public record Channel
[JsonPropertyName("detected_language")]
public string? DetectedLanguage { get; set; }


/// <summary>
/// TODO
/// </summary>
[JsonPropertyName("language_confidence")]
public double? LanguageConfidence { get; set; }

Expand Down
2 changes: 1 addition & 1 deletion Deepgram/Models/PreRecorded/v1/Entity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ public record Entity
/// Value between 0 and 1 indicating the model's relative confidence in this detected entity.
/// </summary>
[JsonPropertyName("confidence")]
public decimal? Confidence { get; set; }
public double? Confidence { get; set; }
}
9 changes: 4 additions & 5 deletions Deepgram/Models/PreRecorded/v1/Hit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,24 @@ public record Hit
/// Value between 0 and 1 that indicates the model's relative confidence in this hit.
/// </summary>
[JsonPropertyName("confidence")]
public decimal Confidence { get; set; }
public double? Confidence { get; set; }


/// <summary>
/// Offset in seconds from the start of the audio to where the hit ends.
/// </summary>
[JsonPropertyName("end")]
public decimal End { get; set; }
public decimal? End { get; set; }

/// <summary>
/// Transcript that corresponds to the time between start and end.
/// </summary>
[JsonPropertyName("snippet")]
public string Snippet { get; set; }
public string? Snippet { get; set; }

/// <summary>
/// Offset in seconds from the start of the audio to where the hit occurs.
/// </summary>
[JsonPropertyName("start")]
public decimal Start { get; set; }

public decimal? Start { get; set; }
}
1 change: 1 addition & 0 deletions Deepgram/Models/PreRecorded/v1/Intent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public record Intent
/// </summary>
[JsonPropertyName("intent")]
public string Intention { get; set; }

/// <summary>
/// <see href="https://developers.deepgram.com/reference/audio-intelligence-apis#intent-recognition"/>
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
namespace Deepgram.Models.PreRecorded.v1;
public record Intents

public record IntentGroup
{
/// <summary>
/// <see href="https://developers.deepgram.com/reference/audio-intelligence-apis#intent-recognition"/>
/// <see cref="IntentSegment"/>
/// </summary>
[JsonPropertyName("segments")]
public IReadOnlyList<IntentSegment>? Segments { get; set; }

}
18 changes: 12 additions & 6 deletions Deepgram/Models/PreRecorded/v1/IntentsInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,23 @@

public record IntentsInfo
{
/// <summary>
/// TODO
/// </summary>
[JsonPropertyName("input_tokens")]
public int InputTokens { get; set; }

/// <summary>
/// TODO
/// </summary>
[JsonPropertyName("model_uuid")]
public string ModelUuid { get; set; }


[JsonPropertyName("input_tokens")]
public int? InputTokens { get; set; }


/// <summary>
/// TODO
/// </summary>
[JsonPropertyName("output_tokens")]
public int? OutputTokens { get; set; }
public int OutputTokens { get; set; }
}


52 changes: 34 additions & 18 deletions Deepgram/Models/PreRecorded/v1/Metadata.cs
Original file line number Diff line number Diff line change
@@ -1,32 +1,43 @@
namespace Deepgram.Models.PreRecorded.v1;
public record Metadata
{
/// <summary>
/// Number of channels detected in the submitted audio.
/// </summary>
[JsonPropertyName("channels")]
public int? Channels { get; set; }

/// <summary>
/// Timestamp that indicates when the audio was submitted.
/// </summary>
[JsonPropertyName("created")]
public DateTime? Created { get; set; }

/// <summary>
/// Number of channels detected in the submitted audio.
/// </summary>
[JsonPropertyName("channels")]
public int? Channels { get; set; }

/// <summary>
/// Duration in seconds of the submitted audio.
/// </summary>
[JsonPropertyName("duration")]
public double? Duration { get; set; }

/// <summary>
/// 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.
/// <see href="https://developers.deepgram.com/docs/extra-metadata"/>
/// </summary>
[JsonPropertyName("extra")]
public Dictionary<string, string> Extra { get; set; }

/// <summary>
/// TODO
/// </summary>
[JsonPropertyName("intents_info")]
public IntentsInfo IntentsInfo { get; set; }

/// <summary>
/// IReadonlyDictionary of <see cref="ModelInfo"/>
/// </summary>
[JsonPropertyName("model_info")]
public Dictionary<string, ModelInfo> ModelInfo { get; set; }


[JsonPropertyName("models")]
public List<string>? Models { get; set; }

Expand All @@ -36,16 +47,29 @@ public record Metadata
[JsonPropertyName("request_id")]
public string? RequestId { get; set; }

/// <summary>
/// TODO.
/// </summary>
[JsonPropertyName("sentiment_info")]
public SentimentInfo SentimentInfo { get; set; }

/// <summary>
/// SHA-256 hash of the submitted audio data.
/// </summary>
[JsonPropertyName("sha256")]
public string? Sha256 { get; set; }

/// <summary>
/// Tags relating to the project
/// TODO
/// </summary>
[JsonPropertyName("summary_info")]
public SummaryInfo SummaryInfo { get; set; }

/// <summary>
/// TODO
/// </summary>
public List<string>? Tags { get; set; }
[JsonPropertyName("topics_info")]
public TopicsInfo TopicsInfo { get; set; }

/// <summary>
/// Blob of text that helps Deepgram engineers debug any problems you encounter.
Expand All @@ -54,17 +78,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; }

/// <summary>
/// Warnings to provide feedback about unsupported and deprecated queries.
/// </summary>
[JsonPropertyName("warnings")]
public List<Warning>? Warnings { get; set; }


}
19 changes: 14 additions & 5 deletions Deepgram/Models/PreRecorded/v1/ModelInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,21 @@

public record ModelInfo
{
/// <summary>
/// TODO
/// </summary>
[JsonPropertyName("arch")]
public string Arch { get; set; }

/// <summary>
/// TODO
/// </summary>
[JsonPropertyName("name")]
public string? Name { get; set; }
public string Name { get; set; }

/// <summary>
/// TODO
/// </summary>
[JsonPropertyName("version")]
public string? Version { get; set; }

[JsonPropertyName("arch")]
public string? Arch { get; set; }
public string Version { get; set; }
}
39 changes: 19 additions & 20 deletions Deepgram/Models/PreRecorded/v1/Paragraph.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,40 @@

public record Paragraph
{
[JsonPropertyName("channel")]
public int? Channel { get; set; }

/// <summary>
/// Offset in seconds from the start of the audio to where the paragraph ends.
/// ReadOnly of Sentence objects.
/// </summary>
[JsonPropertyName("end")]
public decimal? End { get; set; }
[JsonPropertyName("sentences")]
public IReadOnlyList<Sentence>? Sentences { get; set; }

/// <summary>
/// Number of words in the paragraph
/// </summary>
[JsonPropertyName("num_words")]
internal int? NumWords { get; set; }

[JsonPropertyName("paragraphs")]
public IReadOnlyList<Paragraph>? Paragraphs { get; set; }
/// <summary>
/// ReadOnly of Sentence objects.
/// </summary>
[JsonPropertyName("sentences")]
public IReadOnlyList<Sentence>? Sentences { get; set; }

[JsonPropertyName("transcript")]
public string Transcript { get; set; }

[JsonPropertyName("sentiments")]
public List<Sentiments> Sentiments;

/// <summary>
/// Offset in seconds from the start of the audio to where the paragraph starts.
/// </summary>
[JsonPropertyName("start")]
public decimal? Start { get; set; }

/// <summary>
/// Offset in seconds from the start of the audio to where the paragraph ends.
/// </summary>
[JsonPropertyName("end")]
public decimal? End { get; set; }

/// <summary>
/// TODO
/// </summary>
[JsonPropertyName("sentiment")]
public string? Sentiment { get; set; }

/// <summary>
/// TODO
/// </summary>
[JsonPropertyName("sentiment_score")]
public double? SentimentScore { get; set; }
}

Loading

0 comments on commit 7839332

Please sign in to comment.