-
Notifications
You must be signed in to change notification settings - Fork 4.6k
/
AnalyzeTextOptions.cs
51 lines (44 loc) · 2.77 KB
/
AnalyzeTextOptions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
using System.Collections.Generic;
using Azure.Core;
namespace Azure.AI.ContentSafety
{
/// <summary> The analysis request of the text. </summary>
public partial class AnalyzeTextOptions
{
/// <summary> Initializes a new instance of AnalyzeTextOptions. </summary>
/// <param name="text"> The text needs to be scanned. We support at most 1000 characters (unicode code points) in text of one request. </param>
/// <exception cref="ArgumentNullException"> <paramref name="text"/> is null. </exception>
public AnalyzeTextOptions(string text)
{
Argument.AssertNotNull(text, nameof(text));
Text = text;
Categories = new ChangeTrackingList<TextCategory>();
BlocklistNames = new ChangeTrackingList<string>();
}
/// <summary> Initializes a new instance of AnalyzeTextOptions. </summary>
/// <param name="text"> The text needs to be scanned. We support at most 1000 characters (unicode code points) in text of one request. </param>
/// <param name="categories"> The categories will be analyzed. If not assigned, a default set of the categories' analysis results will be returned. </param>
/// <param name="blocklistNames"> The names of blocklists. </param>
/// <param name="breakByBlocklists"> When set to true, further analyses of harmful content will not be performed in cases where blocklists are hit. When set to false, all analyses of harmful content will be performed, whether or not blocklists are hit. </param>
internal AnalyzeTextOptions(string text, IList<TextCategory> categories, IList<string> blocklistNames, bool? breakByBlocklists)
{
Text = text;
Categories = categories;
BlocklistNames = blocklistNames;
BreakByBlocklists = breakByBlocklists;
}
/// <summary> The text needs to be scanned. We support at most 1000 characters (unicode code points) in text of one request. </summary>
public string Text { get; }
/// <summary> The categories will be analyzed. If not assigned, a default set of the categories' analysis results will be returned. </summary>
public IList<TextCategory> Categories { get; }
/// <summary> The names of blocklists. </summary>
public IList<string> BlocklistNames { get; }
/// <summary> When set to true, further analyses of harmful content will not be performed in cases where blocklists are hit. When set to false, all analyses of harmful content will be performed, whether or not blocklists are hit. </summary>
public bool? BreakByBlocklists { get; set; }
}
}