Skip to content

Commit 312e918

Browse files
HavenDVgithub-actions[bot]
andauthored
feat: Updated OpenAPI spec (#88)
Co-authored-by: github-actions[bot] <[email protected]>
1 parent 9e09d5d commit 312e918

5 files changed

+200
-12
lines changed

src/libs/AssemblyAI/Generated/AssemblyAI.JsonSerializerContextTypes.g.cs

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -438,50 +438,54 @@ public sealed partial class JsonSerializerContextTypes
438438
/// <summary>
439439
///
440440
/// </summary>
441-
public global::AssemblyAI.TranscriptParams? Type103 { get; set; }
441+
public global::AssemblyAI.TranscriptOptionalParamsSpeakerOptions? Type103 { get; set; }
442442
/// <summary>
443443
///
444444
/// </summary>
445-
public global::AssemblyAI.TranscriptParamsVariant1? Type104 { get; set; }
445+
public global::AssemblyAI.TranscriptParams? Type104 { get; set; }
446446
/// <summary>
447447
///
448448
/// </summary>
449-
public global::AssemblyAI.TranscriptReadyNotification? Type105 { get; set; }
449+
public global::AssemblyAI.TranscriptParamsVariant1? Type105 { get; set; }
450450
/// <summary>
451451
///
452452
/// </summary>
453-
public global::AssemblyAI.TranscriptReadyStatus? Type106 { get; set; }
453+
public global::AssemblyAI.TranscriptReadyNotification? Type106 { get; set; }
454454
/// <summary>
455455
///
456456
/// </summary>
457-
public global::AssemblyAI.TranscriptWebhookNotification? Type107 { get; set; }
457+
public global::AssemblyAI.TranscriptReadyStatus? Type107 { get; set; }
458458
/// <summary>
459459
///
460460
/// </summary>
461-
public global::AssemblyAI.UploadedFile? Type108 { get; set; }
461+
public global::AssemblyAI.TranscriptWebhookNotification? Type108 { get; set; }
462462
/// <summary>
463463
///
464464
/// </summary>
465-
public global::AssemblyAI.WordSearchMatch? Type109 { get; set; }
465+
public global::AssemblyAI.UploadedFile? Type109 { get; set; }
466466
/// <summary>
467467
///
468468
/// </summary>
469-
public global::System.Collections.Generic.IList<int>? Type110 { get; set; }
469+
public global::AssemblyAI.WordSearchMatch? Type110 { get; set; }
470470
/// <summary>
471471
///
472472
/// </summary>
473-
public global::System.Collections.Generic.IList<global::System.Collections.Generic.IList<int>>? Type111 { get; set; }
473+
public global::System.Collections.Generic.IList<int>? Type111 { get; set; }
474474
/// <summary>
475475
///
476476
/// </summary>
477-
public global::AssemblyAI.WordSearchResponse? Type112 { get; set; }
477+
public global::System.Collections.Generic.IList<global::System.Collections.Generic.IList<int>>? Type112 { get; set; }
478478
/// <summary>
479479
///
480480
/// </summary>
481-
public global::System.Collections.Generic.IList<global::AssemblyAI.WordSearchMatch>? Type113 { get; set; }
481+
public global::AssemblyAI.WordSearchResponse? Type113 { get; set; }
482482
/// <summary>
483483
///
484484
/// </summary>
485-
public byte[]? Type114 { get; set; }
485+
public global::System.Collections.Generic.IList<global::AssemblyAI.WordSearchMatch>? Type114 { get; set; }
486+
/// <summary>
487+
///
488+
/// </summary>
489+
public byte[]? Type115 { get; set; }
486490
}
487491
}

src/libs/AssemblyAI/Generated/AssemblyAI.Models.TranscriptOptionalParams.g.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,12 @@ public sealed partial class TranscriptOptionalParams
220220
[global::System.Text.Json.Serialization.JsonPropertyName("speaker_labels")]
221221
public bool? SpeakerLabels { get; set; }
222222

223+
/// <summary>
224+
/// Specify options for speaker diarization.
225+
/// </summary>
226+
[global::System.Text.Json.Serialization.JsonPropertyName("speaker_options")]
227+
public global::AssemblyAI.TranscriptOptionalParamsSpeakerOptions? SpeakerOptions { get; set; }
228+
223229
/// <summary>
224230
/// Tells the speaker label model how many speakers it should attempt to identify, up to 10. See [Speaker diarization](https://www.assemblyai.com/docs/models/speaker-diarization) for more details.
225231
/// </summary>
@@ -409,6 +415,9 @@ public sealed partial class TranscriptOptionalParams
409415
/// Enable [Speaker diarization](https://www.assemblyai.com/docs/models/speaker-diarization), can be true or false<br/>
410416
/// Default Value: false
411417
/// </param>
418+
/// <param name="speakerOptions">
419+
/// Specify options for speaker diarization.
420+
/// </param>
412421
/// <param name="speakersExpected">
413422
/// Tells the speaker label model how many speakers it should attempt to identify, up to 10. See [Speaker diarization](https://www.assemblyai.com/docs/models/speaker-diarization) for more details.
414423
/// </param>
@@ -476,6 +485,7 @@ public TranscriptOptionalParams(
476485
object? redactPiiSub,
477486
bool? sentimentAnalysis,
478487
bool? speakerLabels,
488+
global::AssemblyAI.TranscriptOptionalParamsSpeakerOptions? speakerOptions,
479489
int? speakersExpected,
480490
object? speechModel,
481491
float? speechThreshold,
@@ -514,6 +524,7 @@ public TranscriptOptionalParams(
514524
this.RedactPiiSub = redactPiiSub;
515525
this.SentimentAnalysis = sentimentAnalysis;
516526
this.SpeakerLabels = speakerLabels;
527+
this.SpeakerOptions = speakerOptions;
517528
this.SpeakersExpected = speakersExpected;
518529
this.SpeechModel = speechModel;
519530
this.SpeechThreshold = speechThreshold;
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
#nullable enable
2+
3+
namespace AssemblyAI
4+
{
5+
public sealed partial class TranscriptOptionalParamsSpeakerOptions
6+
{
7+
/// <summary>
8+
/// Serializes the current instance to a JSON string using the provided JsonSerializerContext.
9+
/// </summary>
10+
public string ToJson(
11+
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
12+
{
13+
return global::System.Text.Json.JsonSerializer.Serialize(
14+
this,
15+
this.GetType(),
16+
jsonSerializerContext);
17+
}
18+
19+
/// <summary>
20+
/// Serializes the current instance to a JSON string using the provided JsonSerializerOptions.
21+
/// </summary>
22+
#if NET8_0_OR_GREATER
23+
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
24+
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
25+
#endif
26+
public string ToJson(
27+
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
28+
{
29+
return global::System.Text.Json.JsonSerializer.Serialize(
30+
this,
31+
jsonSerializerOptions);
32+
}
33+
34+
/// <summary>
35+
/// Deserializes a JSON string using the provided JsonSerializerContext.
36+
/// </summary>
37+
public static global::AssemblyAI.TranscriptOptionalParamsSpeakerOptions? FromJson(
38+
string json,
39+
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
40+
{
41+
return global::System.Text.Json.JsonSerializer.Deserialize(
42+
json,
43+
typeof(global::AssemblyAI.TranscriptOptionalParamsSpeakerOptions),
44+
jsonSerializerContext) as global::AssemblyAI.TranscriptOptionalParamsSpeakerOptions;
45+
}
46+
47+
/// <summary>
48+
/// Deserializes a JSON string using the provided JsonSerializerOptions.
49+
/// </summary>
50+
#if NET8_0_OR_GREATER
51+
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
52+
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
53+
#endif
54+
public static global::AssemblyAI.TranscriptOptionalParamsSpeakerOptions? FromJson(
55+
string json,
56+
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
57+
{
58+
return global::System.Text.Json.JsonSerializer.Deserialize<global::AssemblyAI.TranscriptOptionalParamsSpeakerOptions>(
59+
json,
60+
jsonSerializerOptions);
61+
}
62+
63+
/// <summary>
64+
/// Deserializes a JSON stream using the provided JsonSerializerContext.
65+
/// </summary>
66+
public static async global::System.Threading.Tasks.ValueTask<global::AssemblyAI.TranscriptOptionalParamsSpeakerOptions?> FromJsonStreamAsync(
67+
global::System.IO.Stream jsonStream,
68+
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
69+
{
70+
return (await global::System.Text.Json.JsonSerializer.DeserializeAsync(
71+
jsonStream,
72+
typeof(global::AssemblyAI.TranscriptOptionalParamsSpeakerOptions),
73+
jsonSerializerContext).ConfigureAwait(false)) as global::AssemblyAI.TranscriptOptionalParamsSpeakerOptions;
74+
}
75+
76+
/// <summary>
77+
/// Deserializes a JSON stream using the provided JsonSerializerOptions.
78+
/// </summary>
79+
#if NET8_0_OR_GREATER
80+
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
81+
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
82+
#endif
83+
public static global::System.Threading.Tasks.ValueTask<global::AssemblyAI.TranscriptOptionalParamsSpeakerOptions?> FromJsonStreamAsync(
84+
global::System.IO.Stream jsonStream,
85+
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
86+
{
87+
return global::System.Text.Json.JsonSerializer.DeserializeAsync<global::AssemblyAI.TranscriptOptionalParamsSpeakerOptions?>(
88+
jsonStream,
89+
jsonSerializerOptions);
90+
}
91+
}
92+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
2+
#nullable enable
3+
4+
namespace AssemblyAI
5+
{
6+
/// <summary>
7+
/// Specify options for speaker diarization.
8+
/// </summary>
9+
public sealed partial class TranscriptOptionalParamsSpeakerOptions
10+
{
11+
/// <summary>
12+
/// &lt;Warning&gt;Setting this parameter too high may hurt model accuracy&lt;/Warning&gt;<br/>
13+
/// The maximum number of speakers expected in the audio file.<br/>
14+
/// Default Value: 10
15+
/// </summary>
16+
[global::System.Text.Json.Serialization.JsonPropertyName("max_speakers_expected")]
17+
public int? MaxSpeakersExpected { get; set; }
18+
19+
/// <summary>
20+
/// The minimum number of speakers expected in the audio file.<br/>
21+
/// Default Value: 1
22+
/// </summary>
23+
[global::System.Text.Json.Serialization.JsonPropertyName("min_speakers_expected")]
24+
public int? MinSpeakersExpected { get; set; }
25+
26+
/// <summary>
27+
/// Additional properties that are not explicitly defined in the schema
28+
/// </summary>
29+
[global::System.Text.Json.Serialization.JsonExtensionData]
30+
public global::System.Collections.Generic.IDictionary<string, object> AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary<string, object>();
31+
32+
/// <summary>
33+
/// Initializes a new instance of the <see cref="TranscriptOptionalParamsSpeakerOptions" /> class.
34+
/// </summary>
35+
/// <param name="maxSpeakersExpected">
36+
/// &lt;Warning&gt;Setting this parameter too high may hurt model accuracy&lt;/Warning&gt;<br/>
37+
/// The maximum number of speakers expected in the audio file.<br/>
38+
/// Default Value: 10
39+
/// </param>
40+
/// <param name="minSpeakersExpected">
41+
/// The minimum number of speakers expected in the audio file.<br/>
42+
/// Default Value: 1
43+
/// </param>
44+
#if NET7_0_OR_GREATER
45+
[global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
46+
#endif
47+
public TranscriptOptionalParamsSpeakerOptions(
48+
int? maxSpeakersExpected,
49+
int? minSpeakersExpected)
50+
{
51+
this.MaxSpeakersExpected = maxSpeakersExpected;
52+
this.MinSpeakersExpected = minSpeakersExpected;
53+
}
54+
55+
/// <summary>
56+
/// Initializes a new instance of the <see cref="TranscriptOptionalParamsSpeakerOptions" /> class.
57+
/// </summary>
58+
public TranscriptOptionalParamsSpeakerOptions()
59+
{
60+
}
61+
}
62+
}

src/libs/AssemblyAI/openapi.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,6 +1419,25 @@ components:
14191419
type: [integer, "null"]
14201420
default: null
14211421

1422+
speaker_options:
1423+
x-label: Specify options for speaker diarization.
1424+
description: Specify options for speaker diarization.
1425+
type: object
1426+
additionalProperties: false
1427+
properties:
1428+
min_speakers_expected:
1429+
x-label: Minimum speakers expected
1430+
description: The minimum number of speakers expected in the audio file.
1431+
type: integer
1432+
default: 1
1433+
max_speakers_expected:
1434+
x-label: Maximum speakers expected
1435+
description: |
1436+
<Warning>Setting this parameter too high may hurt model accuracy</Warning>
1437+
The maximum number of speakers expected in the audio file.
1438+
type: integer
1439+
default: 10
1440+
14221441
content_safety:
14231442
x-label: Content Moderation
14241443
description: Enable [Content Moderation](https://www.assemblyai.com/docs/models/content-moderation), can be true or false

0 commit comments

Comments
 (0)