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 +1262 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 invalid OpenAPI array schema: replace "objects" with "items" and correct the field label.

  • OpenAPI uses "items" (not "objects") to define array element schemas. Using "objects" will fail validation and break client generation.
  • The x-label "Minimum speakers expected" is clearly a copy/paste error for an array of languages.

Apply this diff:

             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:
+                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
expected_languages:
x-label: Minimum speakers expected
description: List of languages expected in the audio file.
type: array
objects:
x-label: language
type: string
expected_languages:
x-label: Expected languages
description: List of languages expected in the audio file.
type: array
items:
type: string
🤖 Prompt for AI Agents
In src/libs/AssemblyAI/openapi.yaml around lines 1262-1268 the array schema is
invalid and mislabelled: replace the incorrect "objects" key with the OpenAPI
"items" key to define the element schema, and correct the x-label values so the
array-level label reflects expected languages (e.g., "Expected languages") and
the item-level x-label reflects an individual language (e.g., "language"); keep
the item type as 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 +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

Documentation/type mismatch: fallback_language description suggests an array, but the type is string.

The text says to specify ["auto"], but the schema defines a string. This will confuse users and SDKs.

Apply this diff:

             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 the list of expected languages, the `fallback_language` is used. Set to "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
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"
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. Set to "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 1270 to 1274, the description
for fallback_language refers to specifying ["auto"] (an array) but the schema
sets type: string; change the schema to type: array with items: { type: string }
and set default: ["auto"] (or alternatively adjust the description to reference
a single string if intended); ensure the description matches the schema and
update any examples to use an array of strings when using ["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

Quick validation checks for this spec block.

Run this script to ensure we’ve eliminated the invalid "objects" key, corrected the "auto" guidance, and that the YAML still parses.


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# 1) Fail if any invalid 'objects:' key remains
if rg -n "^\s*objects\s*:" -C2 src/libs/AssemblyAI/openapi.yaml; then
  echo "ERROR: Found invalid 'objects:' key under an array schema."
  exit 1
else
  echo "OK: No 'objects:' keys found."
fi

# 2) Fail if docs still suggest [\"auto\"] (array) for a string field
if rg -n '\["auto"\]' src/libs/AssemblyAI/openapi.yaml; then
  echo 'ERROR: Found ["auto"] in fallback_language description.'
  exit 1
else
  echo 'OK: No ["auto"] mention found.'
fi

# 3) Basic YAML parse sanity check
python - <<'PY'
import yaml, sys
with open("src/libs/AssemblyAI/openapi.yaml", "r") as f:
    yaml.safe_load(f)
print("OK: YAML parsed successfully.")
PY

Length of output: 434


AssemblyAI OpenAPI Spec: Remove Invalid objects Key

The validation script still detects an objects: key under the expected_languages array schema on line 1266. This must be replaced with the correct OpenAPI keyword (items:) before the spec can merge cleanly.

Please update src/libs/AssemblyAI/openapi.yaml as follows:

• File: src/libs/AssemblyAI/openapi.yaml
• Line ~1266: Change
diff - objects: + items:
• Ensure the indented block beneath (x-label: language, type: string) remains unchanged under items:.

After making that change, re-run the validation script to confirm:

#!/bin/bash
set -euo pipefail

# Check for any remaining invalid 'objects:' occurrences
rg -n "^\s*objects\s*:" -C2 src/libs/AssemblyAI/openapi.yaml && \
  (echo "ERROR: 'objects:' key still present"; exit 1) || \
  echo "OK: No 'objects:' keys found."

# Confirm no array-style ["auto"] guidance remains
rg -n '\["auto"\]' src/libs/AssemblyAI/openapi.yaml && \
  (echo "ERROR: Found [\"auto\"] in description"; exit 1) || \
  echo "OK: No [\"auto\"] mention found."

# Verify YAML parses
python - <<'PY'
import yaml
yaml.safe_load(open("src/libs/AssemblyAI/openapi.yaml"))
print("OK: YAML parsed successfully.")
PY

Once the objects: key is removed and replaced with items:, the script should pass without errors.

🤖 Prompt for AI Agents
In src/libs/AssemblyAI/openapi.yaml around lines 1256 to 1275 (approximately
line 1266), replace the invalid OpenAPI key "objects:" under the
expected_languages array with the correct keyword "items:" and keep the indented
block beneath it (x-label: language and type: string) exactly as-is under the
new items: key; then save and re-run the provided validation script to confirm
there are no remaining "objects:" occurrences and YAML parses cleanly.

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