diff --git a/Deepgram.Tests/UnitTests/UtilitiesTests/QueryParameterUtilTests.cs b/Deepgram.Tests/UnitTests/UtilitiesTests/QueryParameterUtilTests.cs index dbddee2e..5e74c247 100644 --- a/Deepgram.Tests/UnitTests/UtilitiesTests/QueryParameterUtilTests.cs +++ b/Deepgram.Tests/UnitTests/UtilitiesTests/QueryParameterUtilTests.cs @@ -1,4 +1,4 @@ -using Deepgram.Models.Manage; +using Deepgram.Models.Manage.v1; using Deepgram.Models.PreRecorded.v1; namespace Deepgram.Tests.UnitTests.UtilitiesTests; diff --git a/Deepgram/AnalyzeClient.cs b/Deepgram/AnalyzeClient.cs new file mode 100644 index 00000000..215a4f95 --- /dev/null +++ b/Deepgram/AnalyzeClient.cs @@ -0,0 +1,148 @@ +using Deepgram.Models.Analyze.v1; +using Deepgram.Models.Authenticate.v1; + +namespace Deepgram; + +/// +/// Client containing methods for interacting with Read API's +/// +/// Required DeepgramApiKey +/// for HttpClient Configuration +public class ReadClient(string apiKey, DeepgramClientOptions? deepgramClientOptions = null) + : AbstractRestClient(apiKey, deepgramClientOptions) +{ + #region NoneCallBacks + /// + /// Transcribe a file by providing a url + /// + /// Url to the file that is to be transcribed + /// Options for the transcription + /// + public async Task TranscribeUrl(UrlSource source, AnalyzeSchema? analyzeSchema, CancellationToken cancellationToken = default) + { + VerifyNoCallBack(nameof(TranscribeUrl), analyzeSchema); + var stringedOptions = QueryParameterUtil.GetParameters(analyzeSchema); + return await PostAsync( + $"{UriSegments.ANALYZE}?{stringedOptions}", + RequestContentUtil.CreatePayload(source), cancellationToken); + } + /// + /// Transcribes a file using the provided byte array + /// + /// file is the form of a byte[] + /// Options for the transcription + /// + public async Task TranscribeFile(byte[] source, AnalyzeSchema? analyzeSchema, CancellationToken cancellationToken = default) + { + VerifyNoCallBack(nameof(TranscribeFile), analyzeSchema); + var stringedOptions = QueryParameterUtil.GetParameters(analyzeSchema); + var stream = new MemoryStream(); + stream.Write(source, 0, source.Length); + return await PostAsync( + $"{UriSegments.ANALYZE}?{stringedOptions}", + RequestContentUtil.CreateStreamPayload(stream), cancellationToken); + } + + /// + /// Transcribes a file using the provided stream + /// + /// file is the form of a stream + /// Options for the transcription + /// + public async Task TranscribeFile(Stream source, AnalyzeSchema? analyzeSchema, CancellationToken cancellationToken = default) + { + VerifyNoCallBack(nameof(TranscribeFile), analyzeSchema); + var stringedOptions = QueryParameterUtil.GetParameters(analyzeSchema); + return await PostAsync( + $"{UriSegments.ANALYZE}?{stringedOptions}", + RequestContentUtil.CreateStreamPayload(source), cancellationToken); + } + + #endregion + + #region CallBack Methods + /// + /// Transcribes a file using the provided byte array and providing a CallBack + /// + /// file is the form of a byte[] + /// CallBack url + /// Options for the transcription + /// + public async Task TranscribeFileCallBack(byte[] source, string? callBack, AnalyzeSchema? analyzeSchema, CancellationToken cancellationToken = default) + { + VerifyOneCallBackSet(nameof(TranscribeFileCallBack), callBack, analyzeSchema); + + if (callBack != null) + analyzeSchema.CallBack = callBack; + var stringedOptions = QueryParameterUtil.GetParameters(analyzeSchema); + var stream = new MemoryStream(); + stream.Write(source, 0, source.Length); + return await PostAsync( + $"{UriSegments.ANALYZE}?{stringedOptions}", + RequestContentUtil.CreateStreamPayload(stream), cancellationToken); + } + + /// + /// Transcribes a file using the provided stream and providing a CallBack + /// + /// file is the form of a stream + /// CallBack url + /// Options for the transcription + /// + public async Task TranscribeFileCallBack(Stream source, string? callBack, AnalyzeSchema? analyzeSchema, CancellationToken cancellationToken = default) + { + VerifyOneCallBackSet(nameof(TranscribeFileCallBack), callBack, analyzeSchema); + if (callBack != null) + analyzeSchema.CallBack = callBack; + var stringedOptions = QueryParameterUtil.GetParameters(analyzeSchema); + return await PostAsync( + $"{UriSegments.ANALYZE}?{stringedOptions}", + RequestContentUtil.CreateStreamPayload(source), cancellationToken); + } + + /// + /// Transcribe a file by providing a url and a CallBack + /// + /// Url to the file that is to be transcribed + /// CallBack url + /// Options for the transcription + /// + public async Task TranscribeUrlCallBack(UrlSource source, string? callBack, AnalyzeSchema? analyzeSchema, CancellationToken cancellationToken = default) + { + VerifyOneCallBackSet(nameof(TranscribeUrlCallBack), callBack, analyzeSchema); + + if (callBack != null) + analyzeSchema.CallBack = callBack; + var stringedOptions = QueryParameterUtil.GetParameters(analyzeSchema); + return await PostAsync( + $"{UriSegments.ANALYZE}?{stringedOptions}", + RequestContentUtil.CreatePayload(source), cancellationToken); + } + #endregion + + #region CallbackChecks + private void VerifyNoCallBack(string method, AnalyzeSchema? analyzeSchema) + { + if (analyzeSchema != null && analyzeSchema.CallBack != null) + throw new ArgumentException($"CallBack cannot be provided as schema option to a synchronous transcription when calling {method}. Use {nameof(TranscribeFileCallBack)} or {nameof(TranscribeUrlCallBack)}"); + } + + private void VerifyOneCallBackSet(string callingMethod, string? callBack, AnalyzeSchema? analyzeSchema) + { + + if (analyzeSchema.CallBack == null && callBack == null) + { //check if no CallBack set in either callBack parameter or AnalyzeSchema + var ex = new ArgumentException($"Either provide a CallBack url or set AnalyzeSchema.CallBack. If no CallBack needed either {nameof(TranscribeUrl)} or {nameof(TranscribeFile)}"); + Log.Exception(_logger, $"While calling {callingMethod} no callback set", ex); + throw ex; + } + else if (!string.IsNullOrEmpty(analyzeSchema.CallBack) && !string.IsNullOrEmpty(callBack)) + { + //check that only one CallBack is set in either callBack parameter or AnalyzeSchema + var ex = new ArgumentException("CallBack should be set in either the CallBack parameter or AnalyzeSchema.CallBack not in both."); + Log.Exception(_logger, $"While calling {callingMethod}, callback set in both parameter and property", ex); + throw ex; + } + } + #endregion +} diff --git a/Deepgram/Constants/UriSegments.cs b/Deepgram/Constants/UriSegments.cs index 0aac30d4..8fb4cff8 100644 --- a/Deepgram/Constants/UriSegments.cs +++ b/Deepgram/Constants/UriSegments.cs @@ -15,4 +15,5 @@ public static class UriSegments public const string LISTEN = "listen"; public const string ONPREM = "onprem/distribution/credentials"; public const string TRANSCRIPTION = "listen"; + public const string ANALYZE = "read"; } diff --git a/Deepgram/Logger/Log.cs b/Deepgram/Logger/Log.cs index a653db9b..b34c7359 100644 --- a/Deepgram/Logger/Log.cs +++ b/Deepgram/Logger/Log.cs @@ -1,4 +1,4 @@ -using Deepgram.Models.Manage; +using Deepgram.Models.Manage.v1; namespace Deepgram.Logger; internal static partial class Log diff --git a/Deepgram/ManageClient.cs b/Deepgram/ManageClient.cs index 42fa0a9e..0df8c340 100644 --- a/Deepgram/ManageClient.cs +++ b/Deepgram/ManageClient.cs @@ -1,5 +1,4 @@ -using Deepgram.Models.Manage; -using Deepgram.Models.Manage.v1; +using Deepgram.Models.Manage.v1; using Deepgram.Models.Authenticate.v1; namespace Deepgram; diff --git a/Deepgram/Models/Analyze/v1/AnalyzeSchema.cs b/Deepgram/Models/Analyze/v1/AnalyzeSchema.cs new file mode 100644 index 00000000..1d07ba4b --- /dev/null +++ b/Deepgram/Models/Analyze/v1/AnalyzeSchema.cs @@ -0,0 +1,71 @@ +namespace Deepgram.Models.Analyze.v1; + +public class AnalyzeSchema +{ + /// + /// TODO + /// + [JsonPropertyName("callback")] + public string? CallBack { get; set; } + + /// + /// TODO + /// + [JsonPropertyName("callback_method")] + public string? CallbackMethod { get; set; } + + /// + /// TODO + /// + [JsonPropertyName("custom_intent")] + public List? CustomIntent { get; set; } + + /// + /// TODO + /// + [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; } + + /// + /// TODO + /// + [JsonPropertyName("intents")] + public bool? Intents { get; set; } + + /// + /// TODO + /// + [JsonPropertyName("language")] + public string? Language { get; set; } + + /// + /// TODO + /// + [JsonPropertyName("sentiment")] + public bool? Sentiment { get; set; } + + /// + /// TODO + /// + [JsonPropertyName("summarize")] + public bool? Summarize { get; set; } + + /// + /// TODO + /// + [JsonPropertyName("topics")] + public bool? Topics { get; set; } +} + diff --git a/Deepgram/Models/Analyze/v1/AsyncResponse.cs b/Deepgram/Models/Analyze/v1/AsyncResponse.cs new file mode 100644 index 00000000..09634c7e --- /dev/null +++ b/Deepgram/Models/Analyze/v1/AsyncResponse.cs @@ -0,0 +1,12 @@ +namespace Deepgram.Models.Analyze.v1; + +public record AsyncResponse +{ + /// + /// Id of transcription request returned when + /// a CallBack has been supplied in request + /// + [JsonPropertyName("request_id")] + public string? RequestId { get; set; } +} + diff --git a/Deepgram/Models/Analyze/v1/Average.cs b/Deepgram/Models/Analyze/v1/Average.cs new file mode 100644 index 00000000..00e5b55a --- /dev/null +++ b/Deepgram/Models/Analyze/v1/Average.cs @@ -0,0 +1,16 @@ +namespace Deepgram.Models.Analyze.v1; + +public record Average +{ + /// + /// TODO + /// + [JsonPropertyName("sentiment")] + public string? Sentiment { get; set; } + + /// + /// TODO + /// + [JsonPropertyName("sentiment_score")] + public double? SentimentScore { get; set; } +} diff --git a/Deepgram/Models/Analyze/v1/Intent.cs b/Deepgram/Models/Analyze/v1/Intent.cs new file mode 100644 index 00000000..56ef300a --- /dev/null +++ b/Deepgram/Models/Analyze/v1/Intent.cs @@ -0,0 +1,19 @@ +namespace Deepgram.Models.Analyze.v1; + +public record Intent +{ + /// + /// + /// + [JsonPropertyName("intent")] + public string? Intention { get; set; } + + /// + /// + /// + [JsonPropertyName("confidence_score")] + public double? ConfidenceScore { get; set; } +} + + + diff --git a/Deepgram/Models/Analyze/v1/IntentGroup.cs b/Deepgram/Models/Analyze/v1/IntentGroup.cs new file mode 100644 index 00000000..f4d9777e --- /dev/null +++ b/Deepgram/Models/Analyze/v1/IntentGroup.cs @@ -0,0 +1,11 @@ +namespace Deepgram.Models.Analyze.v1; + +public record IntentGroup +{ + /// + /// + /// + /// + [JsonPropertyName("segments")] + public IReadOnlyList? Segments { get; set; } +} diff --git a/Deepgram/Models/Analyze/v1/IntentsInfo.cs b/Deepgram/Models/Analyze/v1/IntentsInfo.cs new file mode 100644 index 00000000..e740707d --- /dev/null +++ b/Deepgram/Models/Analyze/v1/IntentsInfo.cs @@ -0,0 +1,24 @@ +namespace Deepgram.Models.Analyze.v1; + +public record IntentsInfo +{ + /// + /// 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/Analyze/v1/Metadata.cs b/Deepgram/Models/Analyze/v1/Metadata.cs new file mode 100644 index 00000000..e99ae5d7 --- /dev/null +++ b/Deepgram/Models/Analyze/v1/Metadata.cs @@ -0,0 +1,46 @@ +namespace Deepgram.Models.Analyze.v1; + +public record Metadata +{ + /// + /// Unique identifier for the submitted audio and derived data returned. + /// + [JsonPropertyName("request_id")] + public string? RequestId { get; set; } + + /// + /// Timestamp that indicates when the audio was submitted. + /// + [JsonPropertyName("created")] + public DateTime? Created { get; set; } + + /// + /// Language detected + /// + [JsonPropertyName("language")] + public string? Language { get; set; } + + /// + /// TODO + /// + [JsonPropertyName("intents_info")] + public IntentsInfo? IntentsInfo { get; set; } + + /// + /// TODO. + /// + [JsonPropertyName("sentiment_info")] + public SentimentInfo? SentimentInfo { get; set; } + + /// + /// TODO + /// + [JsonPropertyName("summary_info")] + public SummaryInfo? SummaryInfo { get; set; } + + /// + /// TODO + /// + [JsonPropertyName("topics_info")] + public TopicsInfo? TopicsInfo { get; set; } +} diff --git a/Deepgram/Models/Analyze/v1/Results.cs b/Deepgram/Models/Analyze/v1/Results.cs new file mode 100644 index 00000000..b9ffe552 --- /dev/null +++ b/Deepgram/Models/Analyze/v1/Results.cs @@ -0,0 +1,29 @@ +namespace Deepgram.Models.Analyze.v1; + +public record Results +{ + /// + /// TODO + /// + [JsonPropertyName("intents")] + public IntentGroup? Intents { get; set; } + + /// + /// TODO + /// + [JsonPropertyName("sentiments")] + public SentimentGroup? Sentiments { get; set; } + + /// + /// Transcription Summary + /// + [JsonPropertyName("summary")] + public Summary? Summary { get; set; } + + /// + /// TODO + /// + [JsonPropertyName("topics")] + public TopicGroup? Topics { get; set; } +} + diff --git a/Deepgram/Models/Analyze/v1/Segment.cs b/Deepgram/Models/Analyze/v1/Segment.cs new file mode 100644 index 00000000..65c77f87 --- /dev/null +++ b/Deepgram/Models/Analyze/v1/Segment.cs @@ -0,0 +1,46 @@ +namespace Deepgram.Models.Analyze.v1; + +public record Segment +{ + /// + /// TODO + /// + [JsonPropertyName("text")] + 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; } + + /// + /// 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/Analyze/v1/SentimentGroup.cs b/Deepgram/Models/Analyze/v1/SentimentGroup.cs new file mode 100644 index 00000000..4e89bb05 --- /dev/null +++ b/Deepgram/Models/Analyze/v1/SentimentGroup.cs @@ -0,0 +1,18 @@ +namespace Deepgram.Models.Analyze.v1; + +public record SentimentGroup +{ + /// + /// TODO + /// + [JsonPropertyName("segments")] + public IReadOnlyList? Segments { get; set; } + + /// + /// TODO + /// + [JsonPropertyName("average")] + public Average? Average { get; set; } +} + + diff --git a/Deepgram/Models/Analyze/v1/SentimentInfo.cs b/Deepgram/Models/Analyze/v1/SentimentInfo.cs new file mode 100644 index 00000000..326fba83 --- /dev/null +++ b/Deepgram/Models/Analyze/v1/SentimentInfo.cs @@ -0,0 +1,24 @@ +namespace Deepgram.Models.Analyze.v1; + +public record SentimentInfo +{ + /// + /// 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/Analyze/v1/Summary.cs b/Deepgram/Models/Analyze/v1/Summary.cs new file mode 100644 index 00000000..fedc1544 --- /dev/null +++ b/Deepgram/Models/Analyze/v1/Summary.cs @@ -0,0 +1,11 @@ +namespace Deepgram.Models.Analyze.v1; + +public record Summary +{ + /// + /// Summary of a section of the transcript + /// + [JsonPropertyName("text")] + public string? Text { get; set; } +} + diff --git a/Deepgram/Models/Analyze/v1/SummaryInfo.cs b/Deepgram/Models/Analyze/v1/SummaryInfo.cs new file mode 100644 index 00000000..6f28634f --- /dev/null +++ b/Deepgram/Models/Analyze/v1/SummaryInfo.cs @@ -0,0 +1,22 @@ +namespace Deepgram.Models.Analyze.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/Analyze/v1/SyncResponse.cs b/Deepgram/Models/Analyze/v1/SyncResponse.cs new file mode 100644 index 00000000..ec1ff926 --- /dev/null +++ b/Deepgram/Models/Analyze/v1/SyncResponse.cs @@ -0,0 +1,16 @@ +namespace Deepgram.Models.Analyze.v1; + +public record SyncResponse +{ + /// + /// Metadata of response + /// + [JsonPropertyName("metadata")] + public Metadata? Metadata { get; set; } + + /// + /// Results of Response + /// + [JsonPropertyName("results")] + public Results? Results { get; set; } +} diff --git a/Deepgram/Models/Analyze/v1/Topic.cs b/Deepgram/Models/Analyze/v1/Topic.cs new file mode 100644 index 00000000..1cc129f2 --- /dev/null +++ b/Deepgram/Models/Analyze/v1/Topic.cs @@ -0,0 +1,17 @@ +namespace Deepgram.Models.Analyze.v1; + +public record Topic +{ + /// + /// Value between 0 and 1 indicating the model's relative confidence in this topic. + /// + [JsonPropertyName("confidence")] + public double? Confidence { get; set; } + + /// + /// TODO + /// + [JsonPropertyName("topic")] + public string Text; +} + diff --git a/Deepgram/Models/Analyze/v1/TopicGroup.cs b/Deepgram/Models/Analyze/v1/TopicGroup.cs new file mode 100644 index 00000000..d19730da --- /dev/null +++ b/Deepgram/Models/Analyze/v1/TopicGroup.cs @@ -0,0 +1,11 @@ +namespace Deepgram.Models.Analyze.v1; + +public record TopicGroup +{ + /// + /// TODO + /// + [JsonPropertyName("segments")] + public IReadOnlyList? Segments { get; set; } +} + diff --git a/Deepgram/Models/Analyze/v1/TopicsInfo.cs b/Deepgram/Models/Analyze/v1/TopicsInfo.cs new file mode 100644 index 00000000..b088bd91 --- /dev/null +++ b/Deepgram/Models/Analyze/v1/TopicsInfo.cs @@ -0,0 +1,24 @@ +namespace Deepgram.Models.Analyze.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/Analyze/v1/UrlSource.cs b/Deepgram/Models/Analyze/v1/UrlSource.cs new file mode 100644 index 00000000..3d7fc189 --- /dev/null +++ b/Deepgram/Models/Analyze/v1/UrlSource.cs @@ -0,0 +1,11 @@ +namespace Deepgram.Models.Analyze.v1; + +public class UrlSource(string url) +{ + /// + /// Url of the file to transcribe + /// + [JsonPropertyName("url")] + public string? Url { get; set; } = url; +} + diff --git a/Deepgram/Models/Live/v1/Average.cs b/Deepgram/Models/Live/v1/Average.cs index 55eb5b6e..71c6343f 100644 --- a/Deepgram/Models/Live/v1/Average.cs +++ b/Deepgram/Models/Live/v1/Average.cs @@ -1,6 +1,6 @@ namespace Deepgram.Models.Live.v1; -public class Average +public record Average { /// /// TODO diff --git a/Deepgram/Models/Live/v1/SpeechstartedResponse.cs b/Deepgram/Models/Live/v1/SpeechStartedResponse.cs similarity index 93% rename from Deepgram/Models/Live/v1/SpeechstartedResponse.cs rename to Deepgram/Models/Live/v1/SpeechStartedResponse.cs index 97a5b89c..be6fbd79 100644 --- a/Deepgram/Models/Live/v1/SpeechstartedResponse.cs +++ b/Deepgram/Models/Live/v1/SpeechStartedResponse.cs @@ -1,6 +1,6 @@ namespace Deepgram.Models.Live.v1; -public class SpeechStartedResponse +public record SpeechStartedResponse { /// /// TODO diff --git a/Deepgram/Models/Live/v1/UtteranceEndResponse.cs b/Deepgram/Models/Live/v1/UtteranceEndResponse.cs index 40cf12bd..28718a32 100644 --- a/Deepgram/Models/Live/v1/UtteranceEndResponse.cs +++ b/Deepgram/Models/Live/v1/UtteranceEndResponse.cs @@ -1,6 +1,6 @@ namespace Deepgram.Models.Live.v1; -public class UtteranceEndResponse +public record UtteranceEndResponse { /// /// TODO diff --git a/Deepgram/Models/Manage/v1/InviteSchema.cs b/Deepgram/Models/Manage/v1/InviteSchema.cs index e8a174ec..c3b7716c 100644 --- a/Deepgram/Models/Manage/v1/InviteSchema.cs +++ b/Deepgram/Models/Manage/v1/InviteSchema.cs @@ -1,4 +1,5 @@ namespace Deepgram.Models.Manage.v1; + public class InviteSchema(string email, string scope) { /// diff --git a/Deepgram/Models/Manage/v1/KeySchema.cs b/Deepgram/Models/Manage/v1/KeySchema.cs index fde9a305..32bcbaff 100644 --- a/Deepgram/Models/Manage/v1/KeySchema.cs +++ b/Deepgram/Models/Manage/v1/KeySchema.cs @@ -1,4 +1,5 @@ -namespace Deepgram.Models.Manage; +namespace Deepgram.Models.Manage.v1; + public class KeySchema(string comment, List scopes) { diff --git a/Deepgram/Models/Manage/v1/KeysResponse.cs b/Deepgram/Models/Manage/v1/KeysResponse.cs index 0d94976e..36a07c78 100644 --- a/Deepgram/Models/Manage/v1/KeysResponse.cs +++ b/Deepgram/Models/Manage/v1/KeysResponse.cs @@ -1,4 +1,5 @@ namespace Deepgram.Models.Manage.v1; + public record KeysResponse { /// diff --git a/Deepgram/Models/Manage/v1/Member.cs b/Deepgram/Models/Manage/v1/Member.cs index 31a09e29..a60639c6 100644 --- a/Deepgram/Models/Manage/v1/Member.cs +++ b/Deepgram/Models/Manage/v1/Member.cs @@ -1,4 +1,5 @@ namespace Deepgram.Models.Manage.v1; + public record Member { /// diff --git a/Deepgram/Models/Manage/v1/MemberScopeSchema.cs b/Deepgram/Models/Manage/v1/MemberScopeSchema.cs index 792d231e..8e2aec1f 100644 --- a/Deepgram/Models/Manage/v1/MemberScopeSchema.cs +++ b/Deepgram/Models/Manage/v1/MemberScopeSchema.cs @@ -1,4 +1,5 @@ namespace Deepgram.Models.Manage.v1; + public class MemberScopeSchema(string scope) { /// diff --git a/Deepgram/Models/Manage/v1/ProjectSchema.cs b/Deepgram/Models/Manage/v1/ProjectSchema.cs index 325f7d7a..aa663cba 100644 --- a/Deepgram/Models/Manage/v1/ProjectSchema.cs +++ b/Deepgram/Models/Manage/v1/ProjectSchema.cs @@ -1,4 +1,5 @@ namespace Deepgram.Models.Manage.v1; + public class ProjectSchema { /// diff --git a/Deepgram/Models/Manage/v1/ProjectsResponse.cs b/Deepgram/Models/Manage/v1/ProjectsResponse.cs index 6561d043..92c0e093 100644 --- a/Deepgram/Models/Manage/v1/ProjectsResponse.cs +++ b/Deepgram/Models/Manage/v1/ProjectsResponse.cs @@ -1,4 +1,5 @@ namespace Deepgram.Models.Manage.v1; + public record ProjectsResponse { /// diff --git a/Deepgram/Models/Manage/v1/UsageFieldsResponse.cs b/Deepgram/Models/Manage/v1/UsageFieldsResponse.cs index 9caa9027..055e8b66 100644 --- a/Deepgram/Models/Manage/v1/UsageFieldsResponse.cs +++ b/Deepgram/Models/Manage/v1/UsageFieldsResponse.cs @@ -1,4 +1,5 @@ namespace Deepgram.Models.Manage.v1; + public record UsageFieldsResponse { /// diff --git a/Deepgram/Models/Manage/v1/UsageRequestsResponse.cs b/Deepgram/Models/Manage/v1/UsageRequestsResponse.cs index 03297a1b..c150900a 100644 --- a/Deepgram/Models/Manage/v1/UsageRequestsResponse.cs +++ b/Deepgram/Models/Manage/v1/UsageRequestsResponse.cs @@ -1,4 +1,5 @@ namespace Deepgram.Models.Manage.v1; + public record UsageRequestsResponse { /// diff --git a/Deepgram/Models/Manage/v1/UsageRequestsSchema.cs b/Deepgram/Models/Manage/v1/UsageRequestsSchema.cs index 7f88d6e8..3ec148b1 100644 --- a/Deepgram/Models/Manage/v1/UsageRequestsSchema.cs +++ b/Deepgram/Models/Manage/v1/UsageRequestsSchema.cs @@ -1,4 +1,5 @@ namespace Deepgram.Models.Manage.v1; + public class UsageRequestsSchema { // diff --git a/Deepgram/Models/Manage/v1/UsageSummaryResponse.cs b/Deepgram/Models/Manage/v1/UsageSummaryResponse.cs index f85a76e4..4b996376 100644 --- a/Deepgram/Models/Manage/v1/UsageSummaryResponse.cs +++ b/Deepgram/Models/Manage/v1/UsageSummaryResponse.cs @@ -1,4 +1,5 @@ namespace Deepgram.Models.Manage.v1; + public record UsageSummaryResponse { /// diff --git a/Deepgram/Models/Manage/v1/UsageSummarySchema.cs b/Deepgram/Models/Manage/v1/UsageSummarySchema.cs index 82587356..8f1b980c 100644 --- a/Deepgram/Models/Manage/v1/UsageSummarySchema.cs +++ b/Deepgram/Models/Manage/v1/UsageSummarySchema.cs @@ -1,4 +1,5 @@ namespace Deepgram.Models.Manage.v1; + public class UsageSummarySchema { /// diff --git a/Deepgram/Models/PreRecorded/v1/AsyncResponse.cs b/Deepgram/Models/PreRecorded/v1/AsyncResponse.cs index 69e9ec0f..341b90f4 100644 --- a/Deepgram/Models/PreRecorded/v1/AsyncResponse.cs +++ b/Deepgram/Models/PreRecorded/v1/AsyncResponse.cs @@ -1,4 +1,5 @@ namespace Deepgram.Models.PreRecorded.v1; + public record AsyncResponse { /// diff --git a/Deepgram/Models/PreRecorded/v1/Average.cs b/Deepgram/Models/PreRecorded/v1/Average.cs index 84a4f16b..0657c1ca 100644 --- a/Deepgram/Models/PreRecorded/v1/Average.cs +++ b/Deepgram/Models/PreRecorded/v1/Average.cs @@ -1,6 +1,6 @@ namespace Deepgram.Models.PreRecorded.v1; -public class Average +public record Average { /// /// TODO diff --git a/Deepgram/Models/PreRecorded/v1/IntentGroup.cs b/Deepgram/Models/PreRecorded/v1/IntentGroup.cs index 8b981301..7dee150c 100644 --- a/Deepgram/Models/PreRecorded/v1/IntentGroup.cs +++ b/Deepgram/Models/PreRecorded/v1/IntentGroup.cs @@ -7,5 +7,5 @@ public record IntentGroup /// /// [JsonPropertyName("segments")] - public IReadOnlyList? Segments { get; set; } + public IReadOnlyList? Segments { get; set; } } diff --git a/Deepgram/Models/PreRecorded/v1/IntentSchema.cs b/Deepgram/Models/PreRecorded/v1/IntentSchema.cs index cb0c4afb..5ea1ae7e 100644 --- a/Deepgram/Models/PreRecorded/v1/IntentSchema.cs +++ b/Deepgram/Models/PreRecorded/v1/IntentSchema.cs @@ -1,4 +1,5 @@ namespace Deepgram.Models.PreRecorded.v1; + public class IntentSchema { /// diff --git a/Deepgram/Models/PreRecorded/v1/IntentSegment.cs b/Deepgram/Models/PreRecorded/v1/IntentSegment.cs deleted file mode 100644 index 3650b1d5..00000000 --- a/Deepgram/Models/PreRecorded/v1/IntentSegment.cs +++ /dev/null @@ -1,29 +0,0 @@ -namespace Deepgram.Models.PreRecorded.v1; - -public record IntentSegment -{ - /// - /// - /// - [JsonPropertyName("text")] - public string? Text { get; set; } - - /// - /// - /// - [JsonPropertyName("start_word")] - public int? StartWord { get; set; } - - /// - /// - /// - [JsonPropertyName("end_word")] - public int? EndWord { get; set; } - - /// - /// - /// - /// - [JsonPropertyName("intents")] - public IReadOnlyList? Intents { get; set; } -} diff --git a/Deepgram/Models/PreRecorded/v1/Metadata.cs b/Deepgram/Models/PreRecorded/v1/Metadata.cs index b32f708a..e72589ed 100644 --- a/Deepgram/Models/PreRecorded/v1/Metadata.cs +++ b/Deepgram/Models/PreRecorded/v1/Metadata.cs @@ -1,4 +1,5 @@ namespace Deepgram.Models.PreRecorded.v1; + public record Metadata { /// diff --git a/Deepgram/Models/PreRecorded/v1/Segment.cs b/Deepgram/Models/PreRecorded/v1/Segment.cs index b68be724..5bfaa0d9 100644 --- a/Deepgram/Models/PreRecorded/v1/Segment.cs +++ b/Deepgram/Models/PreRecorded/v1/Segment.cs @@ -1,6 +1,6 @@ namespace Deepgram.Models.PreRecorded.v1; -public class Segment +public record Segment { /// /// TODO diff --git a/Deepgram/Models/PreRecorded/v1/SentimentGroup.cs b/Deepgram/Models/PreRecorded/v1/SentimentGroup.cs index 5e33501d..4a6ca214 100644 --- a/Deepgram/Models/PreRecorded/v1/SentimentGroup.cs +++ b/Deepgram/Models/PreRecorded/v1/SentimentGroup.cs @@ -1,6 +1,6 @@ namespace Deepgram.Models.PreRecorded.v1; -public class SentimentGroup +public record SentimentGroup { /// /// TODO diff --git a/Deepgram/Models/PreRecorded/v1/SentimentInfo.cs b/Deepgram/Models/PreRecorded/v1/SentimentInfo.cs index 3423812c..0df8300a 100644 --- a/Deepgram/Models/PreRecorded/v1/SentimentInfo.cs +++ b/Deepgram/Models/PreRecorded/v1/SentimentInfo.cs @@ -1,6 +1,6 @@ namespace Deepgram.Models.PreRecorded.v1; -public class SentimentInfo +public record SentimentInfo { /// /// TODO diff --git a/Deepgram/Models/PreRecorded/v1/Topic.cs b/Deepgram/Models/PreRecorded/v1/Topic.cs index 86d7925b..fe206c41 100644 --- a/Deepgram/Models/PreRecorded/v1/Topic.cs +++ b/Deepgram/Models/PreRecorded/v1/Topic.cs @@ -1,6 +1,6 @@ namespace Deepgram.Models.PreRecorded.v1; -public class Topic +public record Topic { /// /// Value between 0 and 1 indicating the model's relative confidence in this topic. diff --git a/Deepgram/ReadClient.cs b/Deepgram/ReadClient.cs deleted file mode 100644 index d7306ee4..00000000 --- a/Deepgram/ReadClient.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Deepgram.Models.Authenticate.v1; - -namespace Deepgram; - -/// -/// Client containing methods for interacting with Read API's -/// -/// Required DeepgramApiKey -/// for HttpClient Configuration -public class ReadClient(string apiKey, DeepgramClientOptions? deepgramClientOptions = null) - : AbstractRestClient(apiKey, deepgramClientOptions) -{ -}