-
-
Notifications
You must be signed in to change notification settings - Fork 1
feat:Add redact_pii_audio_options to transcript parameters in OpenAPI spec #84
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
...blyAI/Generated/AssemblyAI.Models.TranscriptOptionalParamsRedactPiiAudioOptions.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 TranscriptOptionalParamsRedactPiiAudioOptions | ||
| { | ||
| /// <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.TranscriptOptionalParamsRedactPiiAudioOptions? FromJson( | ||
| string json, | ||
| global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) | ||
| { | ||
| return global::System.Text.Json.JsonSerializer.Deserialize( | ||
| json, | ||
| typeof(global::AssemblyAI.TranscriptOptionalParamsRedactPiiAudioOptions), | ||
| jsonSerializerContext) as global::AssemblyAI.TranscriptOptionalParamsRedactPiiAudioOptions; | ||
| } | ||
|
|
||
| /// <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.TranscriptOptionalParamsRedactPiiAudioOptions? FromJson( | ||
| string json, | ||
| global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) | ||
| { | ||
| return global::System.Text.Json.JsonSerializer.Deserialize<global::AssemblyAI.TranscriptOptionalParamsRedactPiiAudioOptions>( | ||
| json, | ||
| jsonSerializerOptions); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Deserializes a JSON stream using the provided JsonSerializerContext. | ||
| /// </summary> | ||
| public static async global::System.Threading.Tasks.ValueTask<global::AssemblyAI.TranscriptOptionalParamsRedactPiiAudioOptions?> 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.TranscriptOptionalParamsRedactPiiAudioOptions), | ||
| jsonSerializerContext).ConfigureAwait(false)) as global::AssemblyAI.TranscriptOptionalParamsRedactPiiAudioOptions; | ||
| } | ||
|
|
||
| /// <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.TranscriptOptionalParamsRedactPiiAudioOptions?> FromJsonStreamAsync( | ||
| global::System.IO.Stream jsonStream, | ||
| global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) | ||
| { | ||
| return global::System.Text.Json.JsonSerializer.DeserializeAsync<global::AssemblyAI.TranscriptOptionalParamsRedactPiiAudioOptions?>( | ||
| jsonStream, | ||
| jsonSerializerOptions); | ||
| } | ||
| } | ||
| } |
47 changes: 47 additions & 0 deletions
47
...AssemblyAI/Generated/AssemblyAI.Models.TranscriptOptionalParamsRedactPiiAudioOptions.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,47 @@ | ||
|
|
||
| #nullable enable | ||
|
|
||
| namespace AssemblyAI | ||
| { | ||
| /// <summary> | ||
| /// Specify options for PII redacted audio files. | ||
| /// </summary> | ||
| public sealed partial class TranscriptOptionalParamsRedactPiiAudioOptions | ||
| { | ||
| /// <summary> | ||
| /// By default, audio redaction provides redacted audio URLs only when speech is detected. However, if your use-case specifically requires redacted audio files even for silent audio files without any dialogue, you can opt to receive these URLs by setting this parameter to `true`.<br/> | ||
| /// Default Value: false | ||
| /// </summary> | ||
| [global::System.Text.Json.Serialization.JsonPropertyName("return_redacted_no_speech_audio")] | ||
| public bool? ReturnRedactedNoSpeechAudio { 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="TranscriptOptionalParamsRedactPiiAudioOptions" /> class. | ||
| /// </summary> | ||
| /// <param name="returnRedactedNoSpeechAudio"> | ||
| /// By default, audio redaction provides redacted audio URLs only when speech is detected. However, if your use-case specifically requires redacted audio files even for silent audio files without any dialogue, you can opt to receive these URLs by setting this parameter to `true`.<br/> | ||
| /// Default Value: false | ||
| /// </param> | ||
| #if NET7_0_OR_GREATER | ||
| [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] | ||
| #endif | ||
| public TranscriptOptionalParamsRedactPiiAudioOptions( | ||
| bool? returnRedactedNoSpeechAudio) | ||
| { | ||
| this.ReturnRedactedNoSpeechAudio = returnRedactedNoSpeechAudio; | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Initializes a new instance of the <see cref="TranscriptOptionalParamsRedactPiiAudioOptions" /> class. | ||
| /// </summary> | ||
| public TranscriptOptionalParamsRedactPiiAudioOptions() | ||
| { | ||
| } | ||
| } | ||
| } |
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
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
Inline schema extraction recommended
Currently
redact_pii_audio_optionsis defined inline underTranscriptOptionalParams. For better modularity, discoverability, and SDK generation, extract this object into a top-level schema (e.g.components/schemas/TranscriptRedactPiiAudioOptions) and reference it via$refinTranscriptOptionalParamsinstead of embedding it inline.🤖 Prompt for AI Agents