-
-
Notifications
You must be signed in to change notification settings - Fork 1
feat:Add language_detection_options to Transcript schemas in OpenAPI #124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
src/libs/AssemblyAI/Generated/AssemblyAI.Models.TranscriptLanguageDetectionOptions.Json.g.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| #nullable enable | ||
|
|
||
| namespace AssemblyAI | ||
| { | ||
| public sealed partial class TranscriptLanguageDetectionOptions | ||
| { | ||
| /// <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.TranscriptLanguageDetectionOptions? FromJson( | ||
| string json, | ||
| global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) | ||
| { | ||
| return global::System.Text.Json.JsonSerializer.Deserialize( | ||
| json, | ||
| typeof(global::AssemblyAI.TranscriptLanguageDetectionOptions), | ||
| jsonSerializerContext) as global::AssemblyAI.TranscriptLanguageDetectionOptions; | ||
| } | ||
|
|
||
| /// <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.TranscriptLanguageDetectionOptions? FromJson( | ||
| string json, | ||
| global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) | ||
| { | ||
| return global::System.Text.Json.JsonSerializer.Deserialize<global::AssemblyAI.TranscriptLanguageDetectionOptions>( | ||
| json, | ||
| jsonSerializerOptions); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Deserializes a JSON stream using the provided JsonSerializerContext. | ||
| /// </summary> | ||
| public static async global::System.Threading.Tasks.ValueTask<global::AssemblyAI.TranscriptLanguageDetectionOptions?> 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.TranscriptLanguageDetectionOptions), | ||
| jsonSerializerContext).ConfigureAwait(false)) as global::AssemblyAI.TranscriptLanguageDetectionOptions; | ||
| } | ||
|
|
||
| /// <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.TranscriptLanguageDetectionOptions?> FromJsonStreamAsync( | ||
| global::System.IO.Stream jsonStream, | ||
| global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) | ||
| { | ||
| return global::System.Text.Json.JsonSerializer.DeserializeAsync<global::AssemblyAI.TranscriptLanguageDetectionOptions?>( | ||
| jsonStream, | ||
| jsonSerializerOptions); | ||
| } | ||
| } | ||
| } |
58 changes: 58 additions & 0 deletions
58
src/libs/AssemblyAI/Generated/AssemblyAI.Models.TranscriptLanguageDetectionOptions.g.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 TranscriptLanguageDetectionOptions | ||
| { | ||
| /// <summary> | ||
| /// List of languages expected in the audio file. Defaults to `["all"]` when unspecified. | ||
| /// </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="TranscriptLanguageDetectionOptions" /> class. | ||
| /// </summary> | ||
| /// <param name="expectedLanguages"> | ||
| /// List of languages expected in the audio file. Defaults to `["all"]` when unspecified. | ||
| /// </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 TranscriptLanguageDetectionOptions( | ||
| byte[]? expectedLanguages, | ||
| string? fallbackLanguage) | ||
| { | ||
| this.ExpectedLanguages = expectedLanguages; | ||
| this.FallbackLanguage = fallbackLanguage; | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Initializes a new instance of the <see cref="TranscriptLanguageDetectionOptions" /> class. | ||
| /// </summary> | ||
| public TranscriptLanguageDetectionOptions() | ||
| { | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Same schema issues in Transcript: replace "objects" with "items", fix label and "auto" text.
Mirror the fixes in the response shape to keep request/response symmetric and valid.
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. Defaults to `["all"]` when unspecified. type: array - objects: + items: 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. + 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"📝 Committable suggestion
🤖 Prompt for AI Agents