Skip to content

Commit

Permalink
adds warning
Browse files Browse the repository at this point in the history
  • Loading branch information
SandraRodgers committed Jul 19, 2023
1 parent cd223df commit 6a07f54
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Deepgram/Transcription/PrerecordedTranscriptionMetaData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ public class PrerecordedTranscriptionMetaData
/// Number of channels detected in the submitted audio.
/// </summary>
[JsonProperty("channels")]
public int Channels { get; set; }
public int Channels { get; set; }

/// <summary>
/// Warnings to provide feedback about unsupported and deprecated queries.
/// </summary>
[JsonProperty("warnings")]
public Warning[] Warnings { get; set; }
}
}
31 changes: 31 additions & 0 deletions Deepgram/Transcription/Warning.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace Deepgram.Transcription
{
public class Warning
{
/// <summary>
/// Parameter sent in the request that resulted in the warning
/// </summary>
[JsonProperty("parameter")]
public string Parameter { get; set; }

/// <summary>
/// The type of warning
/// </summary>
[JsonProperty("type")]
[JsonConverter(typeof(StringEnumConverter))]
public WarningType Type { get; set; }

/// <summary>
/// The warning message
/// </summary>
[JsonProperty("message")]
public string Message { get; set; }

}
}


23 changes: 23 additions & 0 deletions Deepgram/Transcription/WarningType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System;
using System.Runtime.Serialization;

namespace Deepgram.Transcription
{
public enum WarningType

{
[EnumMember(Value = "unsupported_language")]
UnsupportedLanguage,

[EnumMember(Value = "unsupported_model")]
UnsupportedModel,

[EnumMember(Value = "unsupported_encoding")]
UnsupportedEncoding,

[EnumMember(Value = "deprecated")]
Deprecated
}
}


2 changes: 1 addition & 1 deletion SampleApp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace SampleApp
{
class Program
{
const string API_KEY = "24c13ac94b54bd2345dc5d5a93488de63d7d6531";
const string API_KEY = "";

static async Task Main(string[] args)
{
Expand Down

0 comments on commit 6a07f54

Please sign in to comment.