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 @@ -503,7 +503,7 @@ public partial interface ITextToSpeechClient
/// <param name="contentFilter">
/// Opt-in profanity filter for the submitted text. Off by default;<br/>
/// passing this object is the only way to turn it on. The filter<br/>
/// never rewrites your text — it either lets the request through or<br/>
/// rewrites your text only with `action: redact`; otherwise it either lets the request through or<br/>
/// rejects it before synthesis.<br/>
/// `action: "reject"` returns HTTP 400 with `error_code:<br/>
/// "CONTENT_FILTER_BLOCKED"`, the `language` checked and a<br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public partial interface ITextToSpeechClient
/// <param name="contentFilter">
/// Opt-in profanity filter for the submitted text. Off by default;<br/>
/// passing this object is the only way to turn it on. The filter<br/>
/// never rewrites your text — it either lets the request through or<br/>
/// rewrites your text only with `action: redact`; otherwise it either lets the request through or<br/>
/// rejects it before synthesis.<br/>
/// `action: "reject"` returns HTTP 400 with `error_code:<br/>
/// "CONTENT_FILTER_BLOCKED"`, the `language` checked and a<br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public sealed partial class TtsRequest
/// <summary>
/// Opt-in profanity filter for the submitted text. Off by default;<br/>
/// passing this object is the only way to turn it on. The filter<br/>
/// never rewrites your text — it either lets the request through or<br/>
/// rewrites your text only with `action: redact`; otherwise it either lets the request through or<br/>
/// rejects it before synthesis.<br/>
/// `action: "reject"` returns HTTP 400 with `error_code:<br/>
/// "CONTENT_FILTER_BLOCKED"`, the `language` checked and a<br/>
Expand Down Expand Up @@ -347,7 +347,7 @@ public sealed partial class TtsRequest
/// <param name="contentFilter">
/// Opt-in profanity filter for the submitted text. Off by default;<br/>
/// passing this object is the only way to turn it on. The filter<br/>
/// never rewrites your text — it either lets the request through or<br/>
/// rewrites your text only with `action: redact`; otherwise it either lets the request through or<br/>
/// rejects it before synthesis.<br/>
/// `action: "reject"` returns HTTP 400 with `error_code:<br/>
/// "CONTENT_FILTER_BLOCKED"`, the `language` checked and a<br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace SmallestAI
/// <summary>
/// Opt-in profanity filter for the submitted text. Off by default;<br/>
/// passing this object is the only way to turn it on. The filter<br/>
/// never rewrites your text — it either lets the request through or<br/>
/// rewrites your text only with `action: redact`; otherwise it either lets the request through or<br/>
/// rejects it before synthesis.<br/>
/// `action: "reject"` returns HTTP 400 with `error_code:<br/>
/// "CONTENT_FILTER_BLOCKED"`, the `language` checked and a<br/>
Expand All @@ -26,7 +26,7 @@ public sealed partial class TtsRequestContentFilter
public bool? Enabled { get; set; }

/// <summary>
/// What happens on a match. `reject` fails the request with HTTP 400; `flag` synthesizes normally and records the match.<br/>
/// What happens on a match. `reject` fails the request with HTTP 400; `flag` synthesizes normally and records the match; `redact` removes the matched term and synthesizes the rest.<br/>
/// Default Value: reject
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("action")]
Expand All @@ -47,7 +47,7 @@ public sealed partial class TtsRequestContentFilter
/// Default Value: false
/// </param>
/// <param name="action">
/// What happens on a match. `reject` fails the request with HTTP 400; `flag` synthesizes normally and records the match.<br/>
/// What happens on a match. `reject` fails the request with HTTP 400; `flag` synthesizes normally and records the match; `redact` removes the matched term and synthesizes the rest.<br/>
/// Default Value: reject
/// </param>
#if NET7_0_OR_GREATER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace SmallestAI
{
/// <summary>
/// What happens on a match. `reject` fails the request with HTTP 400; `flag` synthesizes normally and records the match.<br/>
/// What happens on a match. `reject` fails the request with HTTP 400; `flag` synthesizes normally and records the match; `redact` removes the matched term and synthesizes the rest.<br/>
/// Default Value: reject
/// </summary>
public enum TtsRequestContentFilterAction
Expand All @@ -16,6 +16,10 @@ public enum TtsRequestContentFilterAction
/// <summary>
///
/// </summary>
Redact,
/// <summary>
///
/// </summary>
Reject,
}

Expand All @@ -32,6 +36,7 @@ public static string ToValueString(this TtsRequestContentFilterAction value)
return value switch
{
TtsRequestContentFilterAction.Flag => "flag",
TtsRequestContentFilterAction.Redact => "redact",
TtsRequestContentFilterAction.Reject => "reject",
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null),
};
Expand All @@ -44,6 +49,7 @@ public static string ToValueString(this TtsRequestContentFilterAction value)
return value switch
{
"flag" => TtsRequestContentFilterAction.Flag,
"redact" => TtsRequestContentFilterAction.Redact,
"reject" => TtsRequestContentFilterAction.Reject,
_ => null,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1459,7 +1459,7 @@ partial void ProcessSynthesizeSpeechResponseContent(
/// <param name="contentFilter">
/// Opt-in profanity filter for the submitted text. Off by default;<br/>
/// passing this object is the only way to turn it on. The filter<br/>
/// never rewrites your text — it either lets the request through or<br/>
/// rewrites your text only with `action: redact`; otherwise it either lets the request through or<br/>
/// rejects it before synthesis.<br/>
/// `action: "reject"` returns HTTP 400 with `error_code:<br/>
/// "CONTENT_FILTER_BLOCKED"`, the `language` checked and a<br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ partial void ProcessSynthesizeSpeechSseResponse(
/// <param name="contentFilter">
/// Opt-in profanity filter for the submitted text. Off by default;<br/>
/// passing this object is the only way to turn it on. The filter<br/>
/// never rewrites your text — it either lets the request through or<br/>
/// rewrites your text only with `action: redact`; otherwise it either lets the request through or<br/>
/// rejects it before synthesis.<br/>
/// `action: "reject"` returns HTTP 400 with `error_code:<br/>
/// "CONTENT_FILTER_BLOCKED"`, the `language` checked and a<br/>
Expand Down
11 changes: 6 additions & 5 deletions src/libs/SmallestAI/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1307,10 +1307,11 @@
"type": "string",
"enum": [
"reject",
"flag"
"flag",
"redact"
],
"default": "reject",
"description": "What happens on a match. `reject` fails the request with HTTP 400; `flag` synthesizes normally and records the match.",
"description": "What happens on a match. `reject` fails the request with HTTP 400; `flag` synthesizes normally and records the match; `redact` removes the matched term and synthesizes the rest.",
"title": "TtsRequestContentFilterAction"
},
"TtsRequestContentFilter": {
Expand All @@ -1324,10 +1325,10 @@
"action": {
"$ref": "#/components/schemas/TtsRequestContentFilterAction",
"default": "reject",
"description": "What happens on a match. `reject` fails the request with HTTP 400; `flag` synthesizes normally and records the match."
"description": "What happens on a match. `reject` fails the request with HTTP 400; `flag` synthesizes normally and records the match; `redact` removes the matched term and synthesizes the rest."
}
},
"description": "Opt-in profanity filter for the submitted text. Off by default;\npassing this object is the only way to turn it on. The filter\nnever rewrites your text — it either lets the request through or\nrejects it before synthesis.\n\n`action: \"reject\"` returns HTTP 400 with `error_code:\n\"CONTENT_FILTER_BLOCKED\"`, the `language` checked and a\n`match_count`; the matched terms are never returned or logged.\n`action: \"flag\"` synthesizes normally and records the match.\n\nMatching is whole-word, not substring. If no verdict is returned\nthe request fails open and the audio is synthesized unfiltered.\n\nSee [Content filter](/models/text-to-speech/content-filter).\n",
"description": "Opt-in profanity filter for the submitted text. Off by default;\npassing this object is the only way to turn it on. The filter\nrewrites your text only with `action: redact`; otherwise it either lets the request through or\nrejects it before synthesis.\n\n`action: \"reject\"` returns HTTP 400 with `error_code:\n\"CONTENT_FILTER_BLOCKED\"`, the `language` checked and a\n`match_count`; the matched terms are never returned or logged.\n`action: \"flag\"` synthesizes normally and records the match.\n\nMatching is whole-word, not substring. If no verdict is returned\nthe request fails open and the audio is synthesized unfiltered.\n\nSee [Content filter](/models/text-to-speech/content-filter).\n",
"title": "TtsRequestContentFilter"
},
"TtsRequestOutputFormat": {
Expand Down Expand Up @@ -1395,7 +1396,7 @@
},
"content_filter": {
"$ref": "#/components/schemas/TtsRequestContentFilter",
"description": "Opt-in profanity filter for the submitted text. Off by default;\npassing this object is the only way to turn it on. The filter\nnever rewrites your text — it either lets the request through or\nrejects it before synthesis.\n\n`action: \"reject\"` returns HTTP 400 with `error_code:\n\"CONTENT_FILTER_BLOCKED\"`, the `language` checked and a\n`match_count`; the matched terms are never returned or logged.\n`action: \"flag\"` synthesizes normally and records the match.\n\nMatching is whole-word, not substring. If no verdict is returned\nthe request fails open and the audio is synthesized unfiltered.\n\nSee [Content filter](/models/text-to-speech/content-filter).\n"
"description": "Opt-in profanity filter for the submitted text. Off by default;\npassing this object is the only way to turn it on. The filter\nrewrites your text only with `action: redact`; otherwise it either lets the request through or\nrejects it before synthesis.\n\n`action: \"reject\"` returns HTTP 400 with `error_code:\n\"CONTENT_FILTER_BLOCKED\"`, the `language` checked and a\n`match_count`; the matched terms are never returned or logged.\n`action: \"flag\"` synthesizes normally and records the match.\n\nMatching is whole-word, not substring. If no verdict is returned\nthe request fails open and the audio is synthesized unfiltered.\n\nSee [Content filter](/models/text-to-speech/content-filter).\n"
},
"output_format": {
"$ref": "#/components/schemas/TtsRequestOutputFormat",
Expand Down
Loading