Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit ce1a02b

Browse files
authored
Merge pull request #46 from AssemblyAI/fern-bot/08-23-2024-0918PM
🌿 Fern Regeneration -- August 23, 2024
2 parents 9d1c0fb + b08ae12 commit ce1a02b

File tree

11 files changed

+109
-72
lines changed

11 files changed

+109
-72
lines changed

.fernignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ src/AssemblyAI/Core/ClientOptions.cs
1313
src/AssemblyAI/Core/JsonConfiguration.cs
1414
src/AssemblyAI/Core/Public/ApiException.cs
1515
src/AssemblyAI/Core/Public/ClientOptions.cs
16+
src/AssemblyAI/Core/CustomConstants.cs
1617
src/AssemblyAI/Types/Error.cs
17-
src/AssemblyAI/Constants.cs
1818
src/AssemblyAI/UserAgent.cs
1919
src/AssemblyAI/Event.cs
2020
src/AssemblyAI/AssemblyAIClient.cs

src/AssemblyAI/AssemblyAI.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
<RootNamespace>AssemblyAI</RootNamespace>
1010
<AssemblyName>AssemblyAI</AssemblyName>
1111
<PackageId>AssemblyAI</PackageId>
12-
<Version>1.0.1</Version>
13-
<AssemblyVersion>1.0.1.0</AssemblyVersion>
14-
<FileVersion>1.0.1.0</FileVersion>
15-
<PackageVersion>1.0.1</PackageVersion>
12+
<Version>1.1.0</Version>
13+
<AssemblyVersion>1.1.0.0</AssemblyVersion>
14+
<FileVersion>1.1.0.0</FileVersion>
15+
<PackageVersion>1.1.0</PackageVersion>
1616
<Title>AssemblyAI C# .NET SDK</Title>
1717
<Authors>AssemblyAI</Authors>
1818
<Description>The AssemblyAI C# .NET SDK provides an easy-to-use interface for interacting with the AssemblyAI API, which supports async and real-time transcription, audio intelligence models, as well as the latest LeMUR models.</Description>

src/AssemblyAI/Core/Constants.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@ namespace AssemblyAI.Core;
22

33
internal static class Constants
44
{
5-
internal const string Version = "1.0.1";
6-
internal const string DateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffK";
5+
public const string DateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffK";
76
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace AssemblyAI.Core;
2+
3+
internal static class CustomConstants
4+
{
5+
internal const string Version = "1.1.0";
6+
}

src/AssemblyAI/Core/Public/AssemblyAIException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ internal AssemblyAIException(string message, Exception? innerException = null)
1313
: base(message, innerException)
1414
{
1515
}
16-
}
16+
}

src/AssemblyAI/Realtime/RealtimeClient.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
using System.Net.Http;
22
using System.Text.Json;
3+
using AssemblyAI;
34
using AssemblyAI.Core;
45

6+
#nullable enable
7+
58
namespace AssemblyAI.Realtime;
69

710
public partial class RealtimeClient
811
{
9-
private readonly RawClient _client;
12+
private RawClient _client;
1013

1114
internal RealtimeClient(RawClient client)
1215
{
@@ -36,7 +39,7 @@ public async Task<RealtimeTemporaryTokenResponse> CreateTemporaryTokenAsync(
3639
{
3740
try
3841
{
39-
return JsonUtils.Deserialize<RealtimeTemporaryTokenResponse>(responseBody);
42+
return JsonUtils.Deserialize<RealtimeTemporaryTokenResponse>(responseBody)!;
4043
}
4144
catch (JsonException e)
4245
{

src/AssemblyAI/Transcripts/Requests/TranscriptParams.cs

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,23 @@ public record TranscriptParams
1515
[JsonPropertyName("language_code")]
1616
public TranscriptLanguageCode? LanguageCode { get; set; }
1717

18+
/// <summary>
19+
/// Enable [Automatic language detection](https://www.assemblyai.com/docs/models/speech-recognition#automatic-language-detection), either true or false.
20+
/// </summary>
21+
[JsonPropertyName("language_detection")]
22+
public bool? LanguageDetection { get; set; }
23+
24+
/// <summary>
25+
/// The confidence threshold for the automatically detected language.
26+
/// An error will be returned if the language confidence is below this threshold.
27+
/// Defaults to 0.
28+
/// </summary>
29+
[JsonPropertyName("language_confidence_threshold")]
30+
public float? LanguageConfidenceThreshold { get; set; }
31+
32+
[JsonPropertyName("speech_model")]
33+
public SpeechModel? SpeechModel { get; set; }
34+
1835
/// <summary>
1936
/// Enable Automatic Punctuation, can be true or false
2037
/// </summary>
@@ -27,15 +44,18 @@ public record TranscriptParams
2744
[JsonPropertyName("format_text")]
2845
public bool? FormatText { get; set; }
2946

47+
/// <summary>
48+
/// Transcribe Filler Words, like "umm", in your media file; can be true or false
49+
/// </summary>
50+
[JsonPropertyName("disfluencies")]
51+
public bool? Disfluencies { get; set; }
52+
3053
/// <summary>
3154
/// Enable [Dual Channel](https://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription) transcription, can be true or false.
3255
/// </summary>
3356
[JsonPropertyName("dual_channel")]
3457
public bool? DualChannel { get; set; }
3558

36-
[JsonPropertyName("speech_model")]
37-
public SpeechModel? SpeechModel { get; set; }
38-
3959
/// <summary>
4060
/// The URL to which we send webhook requests. We sends two different types of webhook requests. One request when a transcript is completed or failed, and one request when the redacted audio is ready if redact_pii_audio is enabled.
4161
/// </summary>
@@ -79,7 +99,7 @@ public record TranscriptParams
7999
public IEnumerable<string>? WordBoost { get; set; }
80100

81101
/// <summary>
82-
/// The word boost parameter value
102+
/// How much to boost specified words
83103
/// </summary>
84104
[JsonPropertyName("boost_param")]
85105
public TranscriptBoostParam? BoostParam { get; set; }
@@ -147,24 +167,12 @@ public record TranscriptParams
147167
[JsonPropertyName("iab_categories")]
148168
public bool? IabCategories { get; set; }
149169

150-
/// <summary>
151-
/// Enable [Automatic language detection](https://www.assemblyai.com/docs/models/speech-recognition#automatic-language-detection), either true or false.
152-
/// </summary>
153-
[JsonPropertyName("language_detection")]
154-
public bool? LanguageDetection { get; set; }
155-
156170
/// <summary>
157171
/// Customize how words are spelled and formatted using to and from values
158172
/// </summary>
159173
[JsonPropertyName("custom_spelling")]
160174
public IEnumerable<TranscriptCustomSpelling>? CustomSpelling { get; set; }
161175

162-
/// <summary>
163-
/// Transcribe Filler Words, like "umm", in your media file; can be true or false
164-
/// </summary>
165-
[JsonPropertyName("disfluencies")]
166-
public bool? Disfluencies { get; set; }
167-
168176
/// <summary>
169177
/// Enable [Sentiment Analysis](https://www.assemblyai.com/docs/models/sentiment-analysis), can be true or false
170178
/// </summary>

src/AssemblyAI/Transcripts/TranscriptsClient.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,7 @@ public async Task<Transcript> GetAsync(string transcriptId, RequestOptions? opti
153153
}
154154

155155
/// <summary>
156-
/// Delete the transcript.
157-
/// Deleting does not delete the resource itself, but removes the data from the resource and marks it as deleted.
156+
/// Remove the data from the transcript and mark it as deleted.
158157
/// </summary>
159158
public async Task<Transcript> DeleteAsync(string transcriptId, RequestOptions? options = null)
160159
{

src/AssemblyAI/Transcripts/Types/Transcript.cs

Lines changed: 41 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,10 @@ public record Transcript
1313
public required string Id { get; set; }
1414

1515
/// <summary>
16-
/// The language model that was used for the transcript
17-
/// </summary>
18-
[JsonPropertyName("language_model")]
19-
public required string LanguageModel { get; set; }
20-
21-
/// <summary>
22-
/// The acoustic model that was used for the transcript
16+
/// The URL of the media that was transcribed
2317
/// </summary>
24-
[JsonPropertyName("acoustic_model")]
25-
public required string AcousticModel { get; set; }
18+
[JsonPropertyName("audio_url")]
19+
public required string AudioUrl { get; set; }
2620

2721
/// <summary>
2822
/// The status of your transcript. Possible values are queued, processing, completed, or error.
@@ -39,10 +33,27 @@ public record Transcript
3933
public TranscriptLanguageCode? LanguageCode { get; set; }
4034

4135
/// <summary>
42-
/// The URL of the media that was transcribed
36+
/// Whether [Automatic language detection](https://www.assemblyai.com/docs/models/speech-recognition#automatic-language-detection) is enabled, either true or false
4337
/// </summary>
44-
[JsonPropertyName("audio_url")]
45-
public required string AudioUrl { get; set; }
38+
[JsonPropertyName("language_detection")]
39+
public bool? LanguageDetection { get; set; }
40+
41+
/// <summary>
42+
/// The confidence threshold for the automatically detected language.
43+
/// An error will be returned if the language confidence is below this threshold.
44+
/// Defaults to 0.
45+
/// </summary>
46+
[JsonPropertyName("language_confidence_threshold")]
47+
public float? LanguageConfidenceThreshold { get; set; }
48+
49+
/// <summary>
50+
/// The confidence score for the detected language, between 0.0 (low confidence) and 1.0 (high confidence)
51+
/// </summary>
52+
[JsonPropertyName("language_confidence")]
53+
public double? LanguageConfidence { get; set; }
54+
55+
[JsonPropertyName("speech_model")]
56+
public SpeechModel? SpeechModel { get; set; }
4657

4758
/// <summary>
4859
/// The textual transcript of your media file
@@ -88,15 +99,18 @@ public record Transcript
8899
[JsonPropertyName("format_text")]
89100
public bool? FormatText { get; set; }
90101

102+
/// <summary>
103+
/// Transcribe Filler Words, like "umm", in your media file; can be true or false
104+
/// </summary>
105+
[JsonPropertyName("disfluencies")]
106+
public bool? Disfluencies { get; set; }
107+
91108
/// <summary>
92109
/// Whether [Dual channel transcription](https://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription) was enabled in the transcription request, either true or false
93110
/// </summary>
94111
[JsonPropertyName("dual_channel")]
95112
public bool? DualChannel { get; set; }
96113

97-
[JsonPropertyName("speech_model")]
98-
public SpeechModel? SpeechModel { get; set; }
99-
100114
/// <summary>
101115
/// The URL to which we send webhook requests.
102116
/// We sends two different types of webhook requests.
@@ -227,12 +241,6 @@ public record Transcript
227241
[JsonPropertyName("iab_categories_result")]
228242
public TopicDetectionModelResult? IabCategoriesResult { get; set; }
229243

230-
/// <summary>
231-
/// Whether [Automatic language detection](https://www.assemblyai.com/docs/models/speech-recognition#automatic-language-detection) is enabled, either true or false
232-
/// </summary>
233-
[JsonPropertyName("language_detection")]
234-
public bool? LanguageDetection { get; set; }
235-
236244
/// <summary>
237245
/// Customize how words are spelled and formatted using to and from values
238246
/// </summary>
@@ -288,12 +296,6 @@ public record Transcript
288296
[JsonPropertyName("topics")]
289297
public IEnumerable<string>? Topics { get; set; }
290298

291-
/// <summary>
292-
/// Transcribe Filler Words, like "umm", in your media file; can be true or false
293-
/// </summary>
294-
[JsonPropertyName("disfluencies")]
295-
public bool? Disfluencies { get; set; }
296-
297299
/// <summary>
298300
/// Whether [Sentiment Analysis](https://www.assemblyai.com/docs/models/sentiment-analysis) is enabled, can be true or false
299301
/// </summary>
@@ -338,4 +340,16 @@ public record Transcript
338340
/// </summary>
339341
[JsonPropertyName("error")]
340342
public string? Error { get; set; }
343+
344+
/// <summary>
345+
/// The language model that was used for the transcript
346+
/// </summary>
347+
[JsonPropertyName("language_model")]
348+
public required string LanguageModel { get; set; }
349+
350+
/// <summary>
351+
/// The acoustic model that was used for the transcript
352+
/// </summary>
353+
[JsonPropertyName("acoustic_model")]
354+
public required string AcousticModel { get; set; }
341355
}

src/AssemblyAI/Transcripts/Types/TranscriptOptionalParams.cs

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,23 @@ public record TranscriptOptionalParams
99
[JsonPropertyName("language_code")]
1010
public TranscriptLanguageCode? LanguageCode { get; set; }
1111

12+
/// <summary>
13+
/// Enable [Automatic language detection](https://www.assemblyai.com/docs/models/speech-recognition#automatic-language-detection), either true or false.
14+
/// </summary>
15+
[JsonPropertyName("language_detection")]
16+
public bool? LanguageDetection { get; set; }
17+
18+
/// <summary>
19+
/// The confidence threshold for the automatically detected language.
20+
/// An error will be returned if the language confidence is below this threshold.
21+
/// Defaults to 0.
22+
/// </summary>
23+
[JsonPropertyName("language_confidence_threshold")]
24+
public float? LanguageConfidenceThreshold { get; set; }
25+
26+
[JsonPropertyName("speech_model")]
27+
public SpeechModel? SpeechModel { get; set; }
28+
1229
/// <summary>
1330
/// Enable Automatic Punctuation, can be true or false
1431
/// </summary>
@@ -21,15 +38,18 @@ public record TranscriptOptionalParams
2138
[JsonPropertyName("format_text")]
2239
public bool? FormatText { get; set; }
2340

41+
/// <summary>
42+
/// Transcribe Filler Words, like "umm", in your media file; can be true or false
43+
/// </summary>
44+
[JsonPropertyName("disfluencies")]
45+
public bool? Disfluencies { get; set; }
46+
2447
/// <summary>
2548
/// Enable [Dual Channel](https://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription) transcription, can be true or false.
2649
/// </summary>
2750
[JsonPropertyName("dual_channel")]
2851
public bool? DualChannel { get; set; }
2952

30-
[JsonPropertyName("speech_model")]
31-
public SpeechModel? SpeechModel { get; set; }
32-
3353
/// <summary>
3454
/// The URL to which we send webhook requests. We sends two different types of webhook requests. One request when a transcript is completed or failed, and one request when the redacted audio is ready if redact_pii_audio is enabled.
3555
/// </summary>
@@ -73,7 +93,7 @@ public record TranscriptOptionalParams
7393
public IEnumerable<string>? WordBoost { get; set; }
7494

7595
/// <summary>
76-
/// The word boost parameter value
96+
/// How much to boost specified words
7797
/// </summary>
7898
[JsonPropertyName("boost_param")]
7999
public TranscriptBoostParam? BoostParam { get; set; }
@@ -141,24 +161,12 @@ public record TranscriptOptionalParams
141161
[JsonPropertyName("iab_categories")]
142162
public bool? IabCategories { get; set; }
143163

144-
/// <summary>
145-
/// Enable [Automatic language detection](https://www.assemblyai.com/docs/models/speech-recognition#automatic-language-detection), either true or false.
146-
/// </summary>
147-
[JsonPropertyName("language_detection")]
148-
public bool? LanguageDetection { get; set; }
149-
150164
/// <summary>
151165
/// Customize how words are spelled and formatted using to and from values
152166
/// </summary>
153167
[JsonPropertyName("custom_spelling")]
154168
public IEnumerable<TranscriptCustomSpelling>? CustomSpelling { get; set; }
155169

156-
/// <summary>
157-
/// Transcribe Filler Words, like "umm", in your media file; can be true or false
158-
/// </summary>
159-
[JsonPropertyName("disfluencies")]
160-
public bool? Disfluencies { get; set; }
161-
162170
/// <summary>
163171
/// Enable [Sentiment Analysis](https://www.assemblyai.com/docs/models/sentiment-analysis), can be true or false
164172
/// </summary>

0 commit comments

Comments
 (0)