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
12 changes: 12 additions & 0 deletions src/libs/AssemblyAI/Generated/AssemblyAI.Models.SpeechModel.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ public enum SpeechModel
///
/// </summary>
Nano,
/// <summary>
///
/// </summary>
Slam1,
/// <summary>
///
/// </summary>
Universal,
}

/// <summary>
Expand All @@ -32,6 +40,8 @@ public static string ToValueString(this SpeechModel value)
{
SpeechModel.Best => "best",
SpeechModel.Nano => "nano",
SpeechModel.Slam1 => "slam-1",
SpeechModel.Universal => "universal",
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null),
};
}
Expand All @@ -44,6 +54,8 @@ public static string ToValueString(this SpeechModel value)
{
"best" => SpeechModel.Best,
"nano" => SpeechModel.Nano,
"slam-1" => SpeechModel.Slam1,
"universal" => SpeechModel.Universal,
_ => null,
};
}
Expand Down
24 changes: 19 additions & 5 deletions src/libs/AssemblyAI/Generated/AssemblyAI.Models.Transcript.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,12 @@ public sealed partial class Transcript
[global::System.Text.Json.Serialization.JsonRequired]
public required global::System.Guid Id { get; set; }

/// <summary>
/// Improve accuracy with up to 1000 domain-specific words or phrases (maximum 6 words per phrase).
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("keyterms_prompt")]
public global::System.Collections.Generic.IList<string>? KeytermsPrompt { get; set; }

/// <summary>
/// The language of your audio file.<br/>
/// Possible values are found in [Supported Languages](https://www.assemblyai.com/docs/concepts/supported-languages).<br/>
Expand Down Expand Up @@ -219,6 +225,13 @@ public sealed partial class Transcript
[global::System.Text.Json.Serialization.JsonPropertyName("multichannel")]
public bool? Multichannel { get; set; }

/// <summary>
/// This parameter does not currently have any functionality attached to it.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("prompt")]
[global::System.Obsolete("This property marked as deprecated.")]
public string? Prompt { get; set; }

/// <summary>
/// Whether Automatic Punctuation is enabled, either true or false
/// </summary>
Expand Down Expand Up @@ -396,6 +409,7 @@ public sealed partial class Transcript
/// The list of custom vocabulary to boost transcription probability for
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("word_boost")]
[global::System.Obsolete("This property marked as deprecated.")]
public global::System.Collections.Generic.IList<string>? WordBoost { get; set; }

/// <summary>
Expand Down Expand Up @@ -490,6 +504,9 @@ public sealed partial class Transcript
/// <param name="id">
/// The unique identifier of your transcript
/// </param>
/// <param name="keytermsPrompt">
/// Improve accuracy with up to 1000 domain-specific words or phrases (maximum 6 words per phrase).
/// </param>
/// <param name="languageCode">
/// The language of your audio file.<br/>
/// Possible values are found in [Supported Languages](https://www.assemblyai.com/docs/concepts/supported-languages).<br/>
Expand Down Expand Up @@ -595,9 +612,6 @@ public sealed partial class Transcript
/// We sends two different types of webhook requests.<br/>
/// One request when a transcript is completed or failed, and one request when the redacted audio is ready if redact_pii_audio is enabled.
/// </param>
/// <param name="wordBoost">
/// The list of custom vocabulary to boost transcription probability for
/// </param>
/// <param name="words">
/// An array of temporally-sequential word objects, one for each word in the transcript.<br/>
/// See [Speech recognition](https://www.assemblyai.com/docs/models/speech-recognition) for more information.
Expand Down Expand Up @@ -638,6 +652,7 @@ public Transcript(
bool? formatText,
bool? iabCategories,
object? iabCategoriesResult,
global::System.Collections.Generic.IList<string>? keytermsPrompt,
global::AssemblyAI.AnyOf<global::AssemblyAI.TranscriptLanguageCode?, string>? languageCode,
bool? languageDetection,
bool? multichannel,
Expand All @@ -661,7 +676,6 @@ public Transcript(
string? webhookAuthHeaderName,
int? webhookStatusCode,
string? webhookUrl,
global::System.Collections.Generic.IList<string>? wordBoost,
global::System.Collections.Generic.IList<global::AssemblyAI.TranscriptWord>? words)
{
this.AcousticModel = acousticModel ?? throw new global::System.ArgumentNullException(nameof(acousticModel));
Expand Down Expand Up @@ -696,6 +710,7 @@ public Transcript(
this.FormatText = formatText;
this.IabCategories = iabCategories;
this.IabCategoriesResult = iabCategoriesResult;
this.KeytermsPrompt = keytermsPrompt;
this.LanguageCode = languageCode;
this.LanguageDetection = languageDetection;
this.Multichannel = multichannel;
Expand All @@ -719,7 +734,6 @@ public Transcript(
this.WebhookAuthHeaderName = webhookAuthHeaderName;
this.WebhookStatusCode = webhookStatusCode;
this.WebhookUrl = webhookUrl;
this.WordBoost = wordBoost;
this.Words = words;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ public sealed partial class TranscriptOptionalParams
[global::System.Text.Json.Serialization.JsonPropertyName("iab_categories")]
public bool? IabCategories { get; set; }

/// <summary>
/// &lt;Warning&gt;`keyterms_prompt` is only supported when the `speech_model` is specified as `slam-1`&lt;/Warning&gt;<br/>
/// Improve accuracy with up to 1000 domain-specific words or phrases (maximum 6 words per phrase).
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("keyterms_prompt")]
public global::System.Collections.Generic.IList<string>? KeytermsPrompt { get; set; }

/// <summary>
/// The language of your audio file. Possible values are found in [Supported Languages](https://www.assemblyai.com/docs/concepts/supported-languages).<br/>
/// The default value is 'en_us'.<br/>
Expand Down Expand Up @@ -143,6 +150,13 @@ public sealed partial class TranscriptOptionalParams
[global::System.Text.Json.Serialization.JsonPropertyName("multichannel")]
public bool? Multichannel { get; set; }

/// <summary>
/// This parameter does not currently have any functionality attached to it.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("prompt")]
[global::System.Obsolete("This property marked as deprecated.")]
public string? Prompt { get; set; }

/// <summary>
/// Enable Automatic Punctuation, can be true or false<br/>
/// Default Value: true
Expand Down Expand Up @@ -272,6 +286,7 @@ public sealed partial class TranscriptOptionalParams
/// The list of custom vocabulary to boost transcription probability for
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("word_boost")]
[global::System.Obsolete("This property marked as deprecated.")]
public global::System.Collections.Generic.IList<string>? WordBoost { get; set; }

/// <summary>
Expand Down Expand Up @@ -331,6 +346,10 @@ public sealed partial class TranscriptOptionalParams
/// Enable [Topic Detection](https://www.assemblyai.com/docs/models/topic-detection), can be true or false<br/>
/// Default Value: false
/// </param>
/// <param name="keytermsPrompt">
/// &lt;Warning&gt;`keyterms_prompt` is only supported when the `speech_model` is specified as `slam-1`&lt;/Warning&gt;<br/>
/// Improve accuracy with up to 1000 domain-specific words or phrases (maximum 6 words per phrase).
/// </param>
/// <param name="languageCode">
/// The language of your audio file. Possible values are found in [Supported Languages](https://www.assemblyai.com/docs/concepts/supported-languages).<br/>
/// The default value is 'en_us'.<br/>
Expand Down Expand Up @@ -417,9 +436,6 @@ public sealed partial class TranscriptOptionalParams
/// We sends two different types of webhook requests.<br/>
/// One request when a transcript is completed or failed, and one request when the redacted audio is ready if redact_pii_audio is enabled.
/// </param>
/// <param name="wordBoost">
/// The list of custom vocabulary to boost transcription probability for
/// </param>
#if NET7_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
#endif
Expand All @@ -437,6 +453,7 @@ public TranscriptOptionalParams(
bool? filterProfanity,
bool? formatText,
bool? iabCategories,
global::System.Collections.Generic.IList<string>? keytermsPrompt,
object? languageCode,
float? languageConfidenceThreshold,
bool? languageDetection,
Expand All @@ -458,8 +475,7 @@ public TranscriptOptionalParams(
global::System.Collections.Generic.IList<string>? topics,
string? webhookAuthHeaderName,
string? webhookAuthHeaderValue,
string? webhookUrl,
global::System.Collections.Generic.IList<string>? wordBoost)
string? webhookUrl)
{
this.AudioEndAt = audioEndAt;
this.AudioStartFrom = audioStartFrom;
Expand All @@ -474,6 +490,7 @@ public TranscriptOptionalParams(
this.FilterProfanity = filterProfanity;
this.FormatText = formatText;
this.IabCategories = iabCategories;
this.KeytermsPrompt = keytermsPrompt;
this.LanguageCode = languageCode;
this.LanguageConfidenceThreshold = languageConfidenceThreshold;
this.LanguageDetection = languageDetection;
Expand All @@ -496,7 +513,6 @@ public TranscriptOptionalParams(
this.WebhookAuthHeaderName = webhookAuthHeaderName;
this.WebhookAuthHeaderValue = webhookAuthHeaderValue;
this.WebhookUrl = webhookUrl;
this.WordBoost = wordBoost;
}

/// <summary>
Expand Down
43 changes: 42 additions & 1 deletion src/libs/AssemblyAI/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1344,6 +1344,7 @@ components:
items:
x-label: Word to boost
type: string
deprecated: true

boost_param:
x-label: Word boost level
Expand Down Expand Up @@ -1431,6 +1432,22 @@ components:
x-label: Custom spelling
$ref: "#/components/schemas/TranscriptCustomSpelling"

keyterms_prompt:
x-label: Keyterms prompt
description: |
<Warning>`keyterms_prompt` is only supported when the `speech_model` is specified as `slam-1`</Warning>
Improve accuracy with up to 1000 domain-specific words or phrases (maximum 6 words per phrase).
type: array
items:
x-label: Keyterm
type: string

Comment on lines +1435 to +1444
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add validation constraints for keyterms_prompt
The description calls out “up to 1000 domain-specific words or phrases (maximum 6 words per phrase)” but the schema lacks any maxItems or per-item length constraints.

Consider adding:

keyterms_prompt:
  type: array
  maxItems: 1000
  items:
    type: string
    # optionally enforce maxLength or pattern to limit to 6 words

to enforce the documented limits.

prompt:
x-label: Prompt
description: This parameter does not currently have any functionality attached to it.
type: string
deprecated: true

sentiment_analysis:
x-label: Sentiment Analysis
description: Enable [Sentiment Analysis](https://www.assemblyai.com/docs/models/sentiment-analysis), can be true or false
Expand Down Expand Up @@ -2150,10 +2167,18 @@ components:
enum:
- best
- nano
- slam-1
- universal
x-fern-enum:
universal:
name: Universal
description: The model optimized for accuracy, low latency, ease of use, and mutli-language support.
slam-1:
name: Slam-1
description: A contextual model optimized for customization.
best:
name: Best
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 typo in model description
There is a spelling mistake: “mutli-language” should be “multi-language.”

-          description: The model optimized for accuracy, low latency, ease of use, and mutli-language support.
+          description: The model optimized for accuracy, low latency, ease of use, and multi-language support.

Committable suggestion skipped: line range outside the PR's diff.

description: The best model optimized for accuracy.
description: The model optimized for accuracy, low latency, ease of use, and mutli-language support.
nano:
name: Nano
description: A lightweight, lower cost model for a wide range of languages.
Expand Down Expand Up @@ -2724,6 +2749,7 @@ components:
items:
x-label: Boosted word
type: string
deprecated: true

boost_param:
x-label: Boost
Expand Down Expand Up @@ -2817,6 +2843,21 @@ components:
x-label: Custom spelling
$ref: "#/components/schemas/TranscriptCustomSpelling"

keyterms_prompt:
x-label: Keyterms prompt
description: |
Improve accuracy with up to 1000 domain-specific words or phrases (maximum 6 words per phrase).
type: array
items:
x-label: Keyterm
type: string

prompt:
x-label: Prompt
description: This parameter does not currently have any functionality attached to it.
type: string
deprecated: true

auto_chapters:
x-label: Auto Chapters enabled
description: Whether [Auto Chapters](https://www.assemblyai.com/docs/models/auto-chapters) is enabled, can be true or false
Expand Down