Skip to content

Commit

Permalink
Merge pull request #204 from dvonthenen/audit-prerecorded-model
Browse files Browse the repository at this point in the history
Audit of PreRecorded Model Classes
  • Loading branch information
dvonthenen authored Feb 5, 2024
2 parents f34d01a + 72d4e43 commit ca5db4c
Show file tree
Hide file tree
Showing 32 changed files with 403 additions and 372 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; }
}
5 changes: 3 additions & 2 deletions Deepgram/Models/PreRecorded/v1/Intent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ public record Intent
/// <see href="https://developers.deepgram.com/reference/audio-intelligence-apis#intent-recognition"/>
/// </summary>
[JsonPropertyName("intent")]
public string Intention { get; set; }
public string? Intention { get; set; }

/// <summary>
/// <see href="https://developers.deepgram.com/reference/audio-intelligence-apis#intent-recognition"/>
/// </summary>
[JsonPropertyName("confidence_score")]
public double ConfidenceScore { get; set; }
public double? ConfidenceScore { get; set; }
}


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; }

}
6 changes: 3 additions & 3 deletions Deepgram/Models/PreRecorded/v1/IntentSchema.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ public class IntentSchema
/// The language of your input audio (Only english is supported at this time)
/// </summary>
[JsonPropertyName("language")]
public string Language { get; set; } = "en";
public string? Language { get; set; } = "en";

/// <summary>
/// Optional. A custom intent you want the model to detect within your input audio if present. Submit up to 100.
/// </summary>
[JsonPropertyName("custom_intent")]
public string CustomIntent { get; set; }
public string? CustomIntent { get; set; }

/// <summary>
/// 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.
/// </summary>
[JsonPropertyName("custom_intent_mode")]
public string CustomIntentMode { get; set; }
public string? CustomIntentMode { get; set; }
}
8 changes: 4 additions & 4 deletions Deepgram/Models/PreRecorded/v1/IntentSegment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ public record IntentSegment
/// <see href="https://developers.deepgram.com/reference/audio-intelligence-apis#intent-recognition"/>
/// </summary>
[JsonPropertyName("text")]
public string Text { get; set; }
public string? Text { get; set; }

/// <summary>
/// <see href="https://developers.deepgram.com/reference/audio-intelligence-apis#intent-recognition"/>
/// </summary>
[JsonPropertyName("start_word")]
public int StartWord { get; set; }
public int? StartWord { get; set; }

/// <summary>
/// <see href="https://developers.deepgram.com/reference/audio-intelligence-apis#intent-recognition"/>
/// </summary>
[JsonPropertyName("end_word")]
public int EndWord { get; set; }
public int? EndWord { get; set; }

/// <summary>
/// <see href="https://developers.deepgram.com/reference/audio-intelligence-apis#intent-recognition"/>
/// <see cref="Intent"/>
/// </summary>
[JsonPropertyName("intents")]
public IReadOnlyList<Intent> Intents { get; set; }
public IReadOnlyList<Intent>? Intents { get; set; }
}
16 changes: 11 additions & 5 deletions Deepgram/Models/PreRecorded/v1/IntentsInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,21 @@

public record IntentsInfo
{

[JsonPropertyName("model_uuid")]
public string ModelUuid { get; set; }


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

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

/// <summary>
/// TODO
/// </summary>
[JsonPropertyName("output_tokens")]
public int? OutputTokens { get; set; }
}
Expand Down
56 changes: 38 additions & 18 deletions Deepgram/Models/PreRecorded/v1/Metadata.cs
Original file line number Diff line number Diff line change
@@ -1,32 +1,47 @@
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; }

public Dictionary<string, ModelInfo>? ModelInfo { get; set; }

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

Expand All @@ -36,16 +51,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>
public List<string>? Tags { get; set; }
[JsonPropertyName("summary_info")]
public SummaryInfo? SummaryInfo { get; set; }

/// <summary>
/// TODO
/// </summary>
[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 +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; }

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


}
15 changes: 12 additions & 3 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; }

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

[JsonPropertyName("arch")]
public string? Arch { get; set; }
}
Loading

0 comments on commit ca5db4c

Please sign in to comment.