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
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 +1256 to +1275
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Fix invalid OpenAPI array schema and misleading docs ("objects" → "items"; '["auto"]' → 'auto').

  • Array items must be under "items", not "objects" (this breaks schema validation).
  • The fallback_language description suggests an array value '["auto"]' but the schema is string; use "auto".
  • Minor copy/paste: x-label for expected_languages says "Minimum speakers expected".

Apply this diff:

 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
+      x-label: Expected languages
       description: List of languages expected in the audio file.
       type: array
-      objects:
-        x-label: language
-        type: string
+      items:
+        x-label: Language code
+        anyOf:
+          - $ref: "#/components/schemas/TranscriptLanguageCode"
+          - type: string
+        x-ts-type: LiteralUnion<TranscriptLanguageCode, string>
     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.
+        If the detected language of the audio file is not in `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"

Run to surface any other misuses of "objects" under arrays and preview the changed block:


🏁 Script executed:

#!/bin/bash
set -euo pipefail
FILE="src/libs/AssemblyAI/openapi.yaml"

echo "Searching for invalid 'objects:' under array types..."
rg -n -C2 -e 'type:\s*array' -e '^\s*objects:' "$FILE"

echo -e "\nShow the language_detection_options snippet for review:"
rg -n -C5 'language_detection_options:' "$FILE"

Length of output: 7921


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE="src/libs/AssemblyAI/openapi.yaml"

echo "Showing language_detection_options block (lines 1256-1275):"
sed -n '1256,1275p' "$FILE"

echo
echo "Searching for TranscriptLanguageCode schema definition:"
rg -n '#/components/schemas/TranscriptLanguageCode' "$FILE" || echo "Not found"

Length of output: 1549


Fix OpenAPI schema for language_detection_options expected_languages and fallback_language

  • File: src/libs/AssemblyAI/openapi.yaml (around lines 1261–1270)
    • Update the x-label for expected_languages from “Minimum speakers expected” to “Expected languages”
    • Replace the invalid objects: key under the expected_languages array with items:
    • Define each item using anyOf to reference the TranscriptLanguageCode enum or a raw string, and add the corresponding x-ts-type
    • Clarify the fallback_language description to instruct passing auto (string) instead of ["auto"]

Apply this diff:

--- a/src/libs/AssemblyAI/openapi.yaml
+++ b/src/libs/AssemblyAI/openapi.yaml
@@ -1261,11 +1261,18 @@
             expected_languages:
-              x-label: Minimum speakers expected
+              x-label: Expected languages
               description: List of languages expected in the audio file.
               type: array
-              objects:
-                x-label: language
-                type: string
+              items:
+                x-label: Language code
+                anyOf:
+                  - $ref: "#/components/schemas/TranscriptLanguageCode"
+                  - type: string
+                x-ts-type: LiteralUnion<TranscriptLanguageCode, string>
             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.
+                If the detected language of the audio file is not in `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"
📝 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
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
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"
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: Expected languages
description: List of languages expected in the audio file.
type: array
items:
x-label: Language code
anyOf:
- $ref: "#/components/schemas/TranscriptLanguageCode"
- type: string
x-ts-type: LiteralUnion<TranscriptLanguageCode, string>
fallback_language:
x-label: Fallback language
description: |
If the detected language of the audio file is not in `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"
🤖 Prompt for AI Agents
In src/libs/AssemblyAI/openapi.yaml around lines 1256-1275, fix the
language_detection_options schema: change the x-label for expected_languages
from "Minimum speakers expected" to "Expected languages"; replace the invalid
objects: key under expected_languages with items: and define each item as anyOf
referencing the TranscriptLanguageCode enum or a plain string, adding the
appropriate x-ts-type to reflect the union; and update the fallback_language
description to instruct passing the string "auto" (not ["auto"]) as the fallback
indicator.

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