Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -434,58 +434,62 @@ public sealed partial class JsonSerializerContextTypes
/// <summary>
///
/// </summary>
public global::AssemblyAI.TranscriptOptionalParamsRedactPiiAudioOptions? Type102 { get; set; }
public global::AssemblyAI.TranscriptOptionalParamsLanguageDetectionOptions? Type102 { get; set; }
/// <summary>
///
/// </summary>
public global::AssemblyAI.TranscriptOptionalParamsSpeakerOptions? Type103 { get; set; }
public byte[]? Type103 { get; set; }
/// <summary>
///
/// </summary>
public global::AssemblyAI.TranscriptParams? Type104 { get; set; }
public global::AssemblyAI.TranscriptOptionalParamsRedactPiiAudioOptions? Type104 { get; set; }
/// <summary>
///
/// </summary>
public global::AssemblyAI.TranscriptParamsVariant1? Type105 { get; set; }
public global::AssemblyAI.TranscriptOptionalParamsSpeakerOptions? Type105 { get; set; }
/// <summary>
///
/// </summary>
public global::AssemblyAI.TranscriptReadyNotification? Type106 { get; set; }
public global::AssemblyAI.TranscriptParams? Type106 { get; set; }
/// <summary>
///
/// </summary>
public global::AssemblyAI.TranscriptReadyStatus? Type107 { get; set; }
public global::AssemblyAI.TranscriptParamsVariant1? Type107 { get; set; }
/// <summary>
///
/// </summary>
public global::AssemblyAI.TranscriptWebhookNotification? Type108 { get; set; }
public global::AssemblyAI.TranscriptReadyNotification? Type108 { get; set; }
/// <summary>
///
/// </summary>
public global::AssemblyAI.UploadedFile? Type109 { get; set; }
public global::AssemblyAI.TranscriptReadyStatus? Type109 { get; set; }
/// <summary>
///
/// </summary>
public global::AssemblyAI.WordSearchMatch? Type110 { get; set; }
public global::AssemblyAI.TranscriptWebhookNotification? Type110 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.IList<int>? Type111 { get; set; }
public global::AssemblyAI.UploadedFile? Type111 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.IList<global::System.Collections.Generic.IList<int>>? Type112 { get; set; }
public global::AssemblyAI.WordSearchMatch? Type112 { get; set; }
/// <summary>
///
/// </summary>
public global::AssemblyAI.WordSearchResponse? Type113 { get; set; }
public global::System.Collections.Generic.IList<int>? Type113 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.IList<global::AssemblyAI.WordSearchMatch>? Type114 { get; set; }
public global::System.Collections.Generic.IList<global::System.Collections.Generic.IList<int>>? Type114 { get; set; }
/// <summary>
///
/// </summary>
public byte[]? Type115 { get; set; }
public global::AssemblyAI.WordSearchResponse? Type115 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.IList<global::AssemblyAI.WordSearchMatch>? Type116 { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ public sealed partial class TranscriptOptionalParams
[global::System.Text.Json.Serialization.JsonPropertyName("language_detection")]
public bool? LanguageDetection { get; set; }

/// <summary>
/// Specify options for Automatic Language Detection.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("language_detection_options")]
public global::AssemblyAI.TranscriptOptionalParamsLanguageDetectionOptions? LanguageDetectionOptions { get; set; }

/// <summary>
/// Enable [Multichannel](https://www.assemblyai.com/docs/models/speech-recognition#multichannel-transcription) transcription, can be true or false.<br/>
/// Default Value: false
Expand Down Expand Up @@ -377,6 +383,9 @@ public sealed partial class TranscriptOptionalParams
/// Enable [Automatic language detection](https://www.assemblyai.com/docs/models/speech-recognition#automatic-language-detection), either true or false.<br/>
/// Default Value: false
/// </param>
/// <param name="languageDetectionOptions">
/// Specify options for Automatic Language Detection.
/// </param>
/// <param name="multichannel">
/// Enable [Multichannel](https://www.assemblyai.com/docs/models/speech-recognition#multichannel-transcription) transcription, can be true or false.<br/>
/// Default Value: false
Expand Down Expand Up @@ -475,6 +484,7 @@ public TranscriptOptionalParams(
object? languageCode,
float? languageConfidenceThreshold,
bool? languageDetection,
global::AssemblyAI.TranscriptOptionalParamsLanguageDetectionOptions? languageDetectionOptions,
bool? multichannel,
bool? punctuate,
bool? redactPii,
Expand Down Expand Up @@ -514,6 +524,7 @@ public TranscriptOptionalParams(
this.LanguageCode = languageCode;
this.LanguageConfidenceThreshold = languageConfidenceThreshold;
this.LanguageDetection = languageDetection;
this.LanguageDetectionOptions = languageDetectionOptions;
this.Multichannel = multichannel;
this.Punctuate = punctuate;
this.RedactPii = redactPii;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#nullable enable

namespace AssemblyAI
{
public sealed partial class TranscriptOptionalParamsLanguageDetectionOptions
{
/// <summary>
/// Serializes the current instance to a JSON string using the provided JsonSerializerContext.
/// </summary>
public string ToJson(
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return global::System.Text.Json.JsonSerializer.Serialize(
this,
this.GetType(),
jsonSerializerContext);
}

/// <summary>
/// Serializes the current instance to a JSON string using the provided JsonSerializerOptions.
/// </summary>
#if NET8_0_OR_GREATER
[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.")]
[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.")]
#endif
public string ToJson(
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.Serialize(
this,
jsonSerializerOptions);
}

/// <summary>
/// Deserializes a JSON string using the provided JsonSerializerContext.
/// </summary>
public static global::AssemblyAI.TranscriptOptionalParamsLanguageDetectionOptions? FromJson(
string json,
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return global::System.Text.Json.JsonSerializer.Deserialize(
json,
typeof(global::AssemblyAI.TranscriptOptionalParamsLanguageDetectionOptions),
jsonSerializerContext) as global::AssemblyAI.TranscriptOptionalParamsLanguageDetectionOptions;
}

/// <summary>
/// Deserializes a JSON string using the provided JsonSerializerOptions.
/// </summary>
#if NET8_0_OR_GREATER
[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.")]
[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.")]
#endif
public static global::AssemblyAI.TranscriptOptionalParamsLanguageDetectionOptions? FromJson(
string json,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.Deserialize<global::AssemblyAI.TranscriptOptionalParamsLanguageDetectionOptions>(
json,
jsonSerializerOptions);
}

/// <summary>
/// Deserializes a JSON stream using the provided JsonSerializerContext.
/// </summary>
public static async global::System.Threading.Tasks.ValueTask<global::AssemblyAI.TranscriptOptionalParamsLanguageDetectionOptions?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream,
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return (await global::System.Text.Json.JsonSerializer.DeserializeAsync(
jsonStream,
typeof(global::AssemblyAI.TranscriptOptionalParamsLanguageDetectionOptions),
jsonSerializerContext).ConfigureAwait(false)) as global::AssemblyAI.TranscriptOptionalParamsLanguageDetectionOptions;
}

/// <summary>
/// Deserializes a JSON stream using the provided JsonSerializerOptions.
/// </summary>
#if NET8_0_OR_GREATER
[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.")]
[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.")]
#endif
public static global::System.Threading.Tasks.ValueTask<global::AssemblyAI.TranscriptOptionalParamsLanguageDetectionOptions?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.DeserializeAsync<global::AssemblyAI.TranscriptOptionalParamsLanguageDetectionOptions?>(
jsonStream,
jsonSerializerOptions);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@

#nullable enable

namespace AssemblyAI
{
/// <summary>
/// Specify options for Automatic Language Detection.
/// </summary>
public sealed partial class TranscriptOptionalParamsLanguageDetectionOptions
{
/// <summary>
/// List of languages expected in the audio file.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("expected_languages")]
public byte[]? ExpectedLanguages { get; set; }

/// <summary>
/// If the detected language of the audio file is not in the list of expected languages, the `fallback_language` is used. Specify `["auto"]` to let our model choose the fallback language from `expected_languages` with the highest confidence score.<br/>
/// Default Value: auto
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("fallback_language")]
public string? FallbackLanguage { get; set; }

/// <summary>
/// Additional properties that are not explicitly defined in the schema
/// </summary>
[global::System.Text.Json.Serialization.JsonExtensionData]
public global::System.Collections.Generic.IDictionary<string, object> AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary<string, object>();

/// <summary>
/// Initializes a new instance of the <see cref="TranscriptOptionalParamsLanguageDetectionOptions" /> class.
/// </summary>
/// <param name="expectedLanguages">
/// List of languages expected in the audio file.
/// </param>
/// <param name="fallbackLanguage">
/// If the detected language of the audio file is not in the list of expected languages, the `fallback_language` is used. Specify `["auto"]` to let our model choose the fallback language from `expected_languages` with the highest confidence score.<br/>
/// Default Value: auto
/// </param>
#if NET7_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
#endif
public TranscriptOptionalParamsLanguageDetectionOptions(
byte[]? expectedLanguages,
string? fallbackLanguage)
{
this.ExpectedLanguages = expectedLanguages;
this.FallbackLanguage = fallbackLanguage;
}

/// <summary>
/// Initializes a new instance of the <see cref="TranscriptOptionalParamsLanguageDetectionOptions" /> class.
/// </summary>
public TranscriptOptionalParamsLanguageDetectionOptions()
{
}
}
}
20 changes: 20 additions & 0 deletions src/libs/AssemblyAI/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1253,6 +1253,26 @@ components:
type: boolean
default: false

language_detection_options:
x-label: Specify options for Automatic Language Detection.
description: Specify options for Automatic Language Detection.
type: object
additionalProperties: false
properties:
expected_languages:
x-label: Minimum speakers expected
description: List of languages expected in the audio file.
type: array
objects:
x-label: language
type: string
Comment on lines +1265 to +1268
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix array schema: use items (not objects) and validate codes.

"objects" is invalid in OAS 3.1 for arrays; use "items". Recommend allowing either TranscriptLanguageCode or free-form string, plus minItems/uniqueItems.

Apply:

-              type: array
-              objects:
-                x-label: language
-                type: string
+              type: array
+              minItems: 1
+              uniqueItems: true
+              items:
+                anyOf:
+                  - $ref: "#/components/schemas/TranscriptLanguageCode"
+                  - type: string
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
type: array
objects:
x-label: language
type: string
type: array
minItems: 1
uniqueItems: true
items:
anyOf:
- $ref: "#/components/schemas/TranscriptLanguageCode"
- type: string
🤖 Prompt for AI Agents
In src/libs/AssemblyAI/openapi.yaml around lines 1265 to 1268, the array schema
incorrectly uses "objects" (invalid in OAS 3.1); replace "objects" with "items"
and make the items accept either the TranscriptLanguageCode reference or a
free-form string (e.g., a oneOf with $ref to TranscriptLanguageCode and type:
string), and add validation such as minItems: 1 and uniqueItems: true to ensure
at least one language and no duplicates.

fallback_language:
x-label: Fallback language
description: |
If the detected language of the audio file is not in the list of expected languages, the `fallback_language` is used. Specify `["auto"]` to let our model choose the fallback language from `expected_languages` with the highest confidence score.
type: string
default: "auto"
Comment on lines +1270 to +1274
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Align description and type for fallback_language.

Description suggests an array value ["auto"] while the type is string. Use "auto" (string) or a language code; enforce via oneOf.

-              description: |
-                If the detected language of the audio file is not in the list of expected languages, the `fallback_language` is used. Specify `["auto"]` to let our model choose the fallback language from `expected_languages` with the highest confidence score.
-              type: string
-              default: "auto"
+              description: |
+                If the detected language is not in `expected_languages`, use this fallback. Specify "auto" to let the model choose the fallback from `expected_languages` with the highest confidence score.
+              oneOf:
+                - const: "auto"
+                - anyOf:
+                    - $ref: "#/components/schemas/TranscriptLanguageCode"
+                    - type: string
+              default: "auto"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
x-label: Fallback language
description: |
If the detected language of the audio file is not in the list of expected languages, the `fallback_language` is used. Specify `["auto"]` to let our model choose the fallback language from `expected_languages` with the highest confidence score.
type: string
default: "auto"
x-label: Fallback language
description: |
If the detected language is not in `expected_languages`, use this fallback. Specify "auto" to let the model choose the fallback from `expected_languages` with the highest confidence score.
oneOf:
- const: "auto"
- anyOf:
- $ref: "#/components/schemas/TranscriptLanguageCode"
- type: string
default: "auto"
🤖 Prompt for AI Agents
In src/libs/AssemblyAI/openapi.yaml around lines 1270 to 1274, the
fallback_language field's description refers to an array value (e.g. ["auto"])
but the schema type is string; change the schema to use oneOf so it accepts
either the string "auto" or an array of language-code strings (oneOf: - {type:
string, enum: ["auto"]} - {type: array, items: {type: string}}) and update the
description to mention that it can be the string "auto" or an array of language
codes.


language_confidence_threshold:
x-label: Language confidence threshold
description: |
Expand Down
Loading