Skip to content
Merged
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,50 +434,54 @@ public sealed partial class JsonSerializerContextTypes
/// <summary>
///
/// </summary>
public global::AssemblyAI.TranscriptParams? Type102 { get; set; }
public global::AssemblyAI.TranscriptOptionalParamsRedactPiiAudioOptions? Type102 { get; set; }
/// <summary>
///
/// </summary>
public global::AssemblyAI.TranscriptParamsVariant1? Type103 { get; set; }
public global::AssemblyAI.TranscriptParams? Type103 { get; set; }
/// <summary>
///
/// </summary>
public global::AssemblyAI.TranscriptReadyNotification? Type104 { get; set; }
public global::AssemblyAI.TranscriptParamsVariant1? Type104 { get; set; }
/// <summary>
///
/// </summary>
public global::AssemblyAI.TranscriptReadyStatus? Type105 { get; set; }
public global::AssemblyAI.TranscriptReadyNotification? Type105 { get; set; }
/// <summary>
///
/// </summary>
public global::AssemblyAI.TranscriptWebhookNotification? Type106 { get; set; }
public global::AssemblyAI.TranscriptReadyStatus? Type106 { get; set; }
/// <summary>
///
/// </summary>
public global::AssemblyAI.UploadedFile? Type107 { get; set; }
public global::AssemblyAI.TranscriptWebhookNotification? Type107 { get; set; }
/// <summary>
///
/// </summary>
public global::AssemblyAI.WordSearchMatch? Type108 { get; set; }
public global::AssemblyAI.UploadedFile? Type108 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.IList<int>? Type109 { get; set; }
public global::AssemblyAI.WordSearchMatch? Type109 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.IList<global::System.Collections.Generic.IList<int>>? Type110 { get; set; }
public global::System.Collections.Generic.IList<int>? Type110 { get; set; }
/// <summary>
///
/// </summary>
public global::AssemblyAI.WordSearchResponse? Type111 { get; set; }
public global::System.Collections.Generic.IList<global::System.Collections.Generic.IList<int>>? Type111 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.IList<global::AssemblyAI.WordSearchMatch>? Type112 { get; set; }
public global::AssemblyAI.WordSearchResponse? Type112 { get; set; }
/// <summary>
///
/// </summary>
public byte[]? Type113 { get; set; }
public global::System.Collections.Generic.IList<global::AssemblyAI.WordSearchMatch>? Type113 { get; set; }
/// <summary>
///
/// </summary>
public byte[]? Type114 { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ public sealed partial class TranscriptOptionalParams
[global::System.Text.Json.Serialization.JsonPropertyName("redact_pii_audio")]
public bool? RedactPiiAudio { get; set; }

/// <summary>
/// Specify options for PII redacted audio files.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("redact_pii_audio_options")]
public global::AssemblyAI.TranscriptOptionalParamsRedactPiiAudioOptions? RedactPiiAudioOptions { get; set; }

/// <summary>
/// Controls the filetype of the audio created by redact_pii_audio. Currently supports mp3 (default) and wav. See [PII redaction](https://www.assemblyai.com/docs/models/pii-redaction) for more details.<br/>
/// Example: mp3
Expand Down Expand Up @@ -381,6 +387,9 @@ public sealed partial class TranscriptOptionalParams
/// Generate a copy of the original media file with spoken PII "beeped" out, can be true or false. See [PII redaction](https://www.assemblyai.com/docs/models/pii-redaction) for more details.<br/>
/// Default Value: false
/// </param>
/// <param name="redactPiiAudioOptions">
/// Specify options for PII redacted audio files.
/// </param>
/// <param name="redactPiiAudioQuality">
/// Controls the filetype of the audio created by redact_pii_audio. Currently supports mp3 (default) and wav. See [PII redaction](https://www.assemblyai.com/docs/models/pii-redaction) for more details.<br/>
/// Example: mp3
Expand Down Expand Up @@ -461,6 +470,7 @@ public TranscriptOptionalParams(
bool? punctuate,
bool? redactPii,
bool? redactPiiAudio,
global::AssemblyAI.TranscriptOptionalParamsRedactPiiAudioOptions? redactPiiAudioOptions,
global::AssemblyAI.RedactPiiAudioQuality? redactPiiAudioQuality,
global::System.Collections.Generic.IList<global::AssemblyAI.PiiPolicy>? redactPiiPolicies,
object? redactPiiSub,
Expand Down Expand Up @@ -498,6 +508,7 @@ public TranscriptOptionalParams(
this.Punctuate = punctuate;
this.RedactPii = redactPii;
this.RedactPiiAudio = redactPiiAudio;
this.RedactPiiAudioOptions = redactPiiAudioOptions;
this.RedactPiiAudioQuality = redactPiiAudioQuality;
this.RedactPiiPolicies = redactPiiPolicies;
this.RedactPiiSub = redactPiiSub;
Expand Down
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);
}
}
}
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()
{
}
}
}
12 changes: 12 additions & 0 deletions src/libs/AssemblyAI/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1390,6 +1390,18 @@ components:
- type: "null"
default: hash

redact_pii_audio_options:
x-label: Specify options for PII redacted audio files.
description: Specify options for PII redacted audio files.
type: object
additionalProperties: false
Comment on lines +1393 to +1397
Copy link

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_options is defined inline under TranscriptOptionalParams. For better modularity, discoverability, and SDK generation, extract this object into a top-level schema (e.g. components/schemas/TranscriptRedactPiiAudioOptions) and reference it via $ref in TranscriptOptionalParams instead of embedding it inline.

🤖 Prompt for AI Agents
In src/libs/AssemblyAI/openapi.yaml around lines 1393 to 1397, the
redact_pii_audio_options object is defined inline within
TranscriptOptionalParams. To improve modularity and SDK generation, extract
redact_pii_audio_options into a separate top-level schema named
TranscriptRedactPiiAudioOptions under components/schemas, then replace the
inline definition in TranscriptOptionalParams with a $ref pointing to this new
schema.

properties:
return_redacted_no_speech_audio:
x-label: Return redacted no speech audio
description: 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`.
type: boolean
default: false

speaker_labels:
x-label: Speaker labels
description: Enable [Speaker diarization](https://www.assemblyai.com/docs/models/speaker-diarization), can be true or false
Expand Down