Debian Codegraph @

docs/dyn/checks_v1alpha.aisafety.html

raw
1 <html><body>
2 <style>
3
4 body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13 }
14
15 body {
16 font-size: 13px;
17 padding: 1em;
18 }
19
20 h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23 }
24
25 h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28 }
29
30 h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34 }
35
36 pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39 }
40
41 pre {
42 margin-top: 0.5em;
43 }
44
45 h1, h2, h3, p {
46 font-family: Arial, sans serif;
47 }
48
49 h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51 }
52
53 .toc_element {
54 margin-top: 0.5em;
55 }
56
57 .firstline {
58 margin-left: 2 em;
59 }
60
61 .method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66 }
67
68 .details {
69 font-weight: bold;
70 font-size: 14px;
71 }
72
73 </style>
74
75 <h1><a href="checks_v1alpha.html">Checks API</a> . <a href="checks_v1alpha.aisafety.html">aisafety</a></h1>
76 <h2>Instance Methods</h2>
77 <p class="toc_element">
78 <code><a href="#classifyContent">classifyContent(body=None, x__xgafv=None)</a></code></p>
79 <p class="firstline">Analyze a piece of content with the provided set of policies.</p>
80 <p class="toc_element">
81 <code><a href="#close">close()</a></code></p>
82 <p class="firstline">Close httplib2 connections.</p>
83 <h3>Method Details</h3>
84 <div class="method">
85 <code class="details" id="classifyContent">classifyContent(body=None, x__xgafv=None)</code>
86 <pre>Analyze a piece of content with the provided set of policies.
87
88 Args:
89 body: object, The request body.
90 The object takes the form of:
91
92 { # Request proto for ClassifyContent RPC.
93 &quot;classifierVersion&quot;: &quot;A String&quot;, # Optional. Version of the classifier to use. If not specified, the latest version will be used.
94 &quot;context&quot;: { # Context about the input that will be used to help on the classification. # Optional. Context about the input that will be used to help on the classification.
95 &quot;prompt&quot;: &quot;A String&quot;, # Optional. Prompt that generated the model response.
96 },
97 &quot;input&quot;: { # Content to be classified. # Required. Content to be classified.
98 &quot;textInput&quot;: { # Text input to be classified. # Content in text format.
99 &quot;content&quot;: &quot;A String&quot;, # Actual piece of text to be classified.
100 &quot;languageCode&quot;: &quot;A String&quot;, # Optional. Language of the text in ISO 639-1 format. If the language is invalid or not specified, the system will try to detect it.
101 },
102 },
103 &quot;policies&quot;: [ # Required. List of policies to classify against.
104 { # List of policies to classify against.
105 &quot;policyType&quot;: &quot;A String&quot;, # Required. Type of the policy.
106 &quot;threshold&quot;: 3.14, # Optional. Score threshold to use when deciding if the content is violative or non-violative. If not specified, the default 0.5 threshold for the policy will be used.
107 },
108 ],
109 }
110
111 x__xgafv: string, V1 error format.
112 Allowed values
113 1 - v1 error format
114 2 - v2 error format
115
116 Returns:
117 An object of the form:
118
119 { # Response proto for ClassifyContent RPC.
120 &quot;policyResults&quot;: [ # Results of the classification for each policy.
121 { # Result for one policy against the corresponding input.
122 &quot;policyType&quot;: &quot;A String&quot;, # Type of the policy.
123 &quot;score&quot;: 3.14, # Final score for the results of this policy.
124 &quot;violationResult&quot;: &quot;A String&quot;, # Result of the classification for the policy.
125 },
126 ],
127 }</pre>
128 </div>
129
130 <div class="method">
131 <code class="details" id="close">close()</code>
132 <pre>Close httplib2 connections.</pre>
133 </div>
134
135 </body></html>