google-apis-checks_v1alpha 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eaa5f3394d18f6716a954f4ca0c38b3ff8a26288ea43ae0b5abdbd90b71df7cc
|
4
|
+
data.tar.gz: cb8fcf93f4fbb64044d042e46c8bb3c03377e4adbbae19d550c2fa5a8f94b2d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1fbed43d14a80a761251647fc4252554ca5eef3c723f86e94b6f5a8571de25e140d7c1cfa91af74835fbb468672f0b24a02f86320f88dd22cbe26f4962e6ea8
|
7
|
+
data.tar.gz: af148faba187020efade62c80aecc20424a806cf18b26df498f01d05cb92bb7e98466588e0b18c1b5ff4762f46ac244de1d3a23afa63dd07b9f94fd167f20041
|
data/CHANGELOG.md
CHANGED
@@ -102,6 +102,185 @@ module Google
|
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|
105
|
+
# Request proto for ClassifyContent RPC.
|
106
|
+
class GoogleChecksAisafetyV1alphaClassifyContentRequest
|
107
|
+
include Google::Apis::Core::Hashable
|
108
|
+
|
109
|
+
# Optional. Version of the classifier to use. If not specified, the latest
|
110
|
+
# version will be used.
|
111
|
+
# Corresponds to the JSON property `classifierVersion`
|
112
|
+
# @return [String]
|
113
|
+
attr_accessor :classifier_version
|
114
|
+
|
115
|
+
# Context about the input that will be used to help on the classification.
|
116
|
+
# Corresponds to the JSON property `context`
|
117
|
+
# @return [Google::Apis::ChecksV1alpha::GoogleChecksAisafetyV1alphaClassifyContentRequestContext]
|
118
|
+
attr_accessor :context
|
119
|
+
|
120
|
+
# Content to be classified.
|
121
|
+
# Corresponds to the JSON property `input`
|
122
|
+
# @return [Google::Apis::ChecksV1alpha::GoogleChecksAisafetyV1alphaClassifyContentRequestInputContent]
|
123
|
+
attr_accessor :input
|
124
|
+
|
125
|
+
# Required. List of policies to classify against.
|
126
|
+
# Corresponds to the JSON property `policies`
|
127
|
+
# @return [Array<Google::Apis::ChecksV1alpha::GoogleChecksAisafetyV1alphaClassifyContentRequestPolicyConfig>]
|
128
|
+
attr_accessor :policies
|
129
|
+
|
130
|
+
def initialize(**args)
|
131
|
+
update!(**args)
|
132
|
+
end
|
133
|
+
|
134
|
+
# Update properties of this object
|
135
|
+
def update!(**args)
|
136
|
+
@classifier_version = args[:classifier_version] if args.key?(:classifier_version)
|
137
|
+
@context = args[:context] if args.key?(:context)
|
138
|
+
@input = args[:input] if args.key?(:input)
|
139
|
+
@policies = args[:policies] if args.key?(:policies)
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
# Context about the input that will be used to help on the classification.
|
144
|
+
class GoogleChecksAisafetyV1alphaClassifyContentRequestContext
|
145
|
+
include Google::Apis::Core::Hashable
|
146
|
+
|
147
|
+
# Optional. Prompt that generated the model response.
|
148
|
+
# Corresponds to the JSON property `prompt`
|
149
|
+
# @return [String]
|
150
|
+
attr_accessor :prompt
|
151
|
+
|
152
|
+
def initialize(**args)
|
153
|
+
update!(**args)
|
154
|
+
end
|
155
|
+
|
156
|
+
# Update properties of this object
|
157
|
+
def update!(**args)
|
158
|
+
@prompt = args[:prompt] if args.key?(:prompt)
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
# Content to be classified.
|
163
|
+
class GoogleChecksAisafetyV1alphaClassifyContentRequestInputContent
|
164
|
+
include Google::Apis::Core::Hashable
|
165
|
+
|
166
|
+
# Text input to be classified.
|
167
|
+
# Corresponds to the JSON property `textInput`
|
168
|
+
# @return [Google::Apis::ChecksV1alpha::GoogleChecksAisafetyV1alphaTextInput]
|
169
|
+
attr_accessor :text_input
|
170
|
+
|
171
|
+
def initialize(**args)
|
172
|
+
update!(**args)
|
173
|
+
end
|
174
|
+
|
175
|
+
# Update properties of this object
|
176
|
+
def update!(**args)
|
177
|
+
@text_input = args[:text_input] if args.key?(:text_input)
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
# List of policies to classify against.
|
182
|
+
class GoogleChecksAisafetyV1alphaClassifyContentRequestPolicyConfig
|
183
|
+
include Google::Apis::Core::Hashable
|
184
|
+
|
185
|
+
# Required. Type of the policy.
|
186
|
+
# Corresponds to the JSON property `policyType`
|
187
|
+
# @return [String]
|
188
|
+
attr_accessor :policy_type
|
189
|
+
|
190
|
+
# Optional. Score threshold to use when deciding if the content is violative or
|
191
|
+
# non-violative. If not specified, the default 0.5 threshold for the policy will
|
192
|
+
# be used.
|
193
|
+
# Corresponds to the JSON property `threshold`
|
194
|
+
# @return [Float]
|
195
|
+
attr_accessor :threshold
|
196
|
+
|
197
|
+
def initialize(**args)
|
198
|
+
update!(**args)
|
199
|
+
end
|
200
|
+
|
201
|
+
# Update properties of this object
|
202
|
+
def update!(**args)
|
203
|
+
@policy_type = args[:policy_type] if args.key?(:policy_type)
|
204
|
+
@threshold = args[:threshold] if args.key?(:threshold)
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
# Response proto for ClassifyContent RPC.
|
209
|
+
class GoogleChecksAisafetyV1alphaClassifyContentResponse
|
210
|
+
include Google::Apis::Core::Hashable
|
211
|
+
|
212
|
+
# Results of the classification for each policy.
|
213
|
+
# Corresponds to the JSON property `policyResults`
|
214
|
+
# @return [Array<Google::Apis::ChecksV1alpha::GoogleChecksAisafetyV1alphaClassifyContentResponsePolicyResult>]
|
215
|
+
attr_accessor :policy_results
|
216
|
+
|
217
|
+
def initialize(**args)
|
218
|
+
update!(**args)
|
219
|
+
end
|
220
|
+
|
221
|
+
# Update properties of this object
|
222
|
+
def update!(**args)
|
223
|
+
@policy_results = args[:policy_results] if args.key?(:policy_results)
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
227
|
+
# Result for one policy against the corresponding input.
|
228
|
+
class GoogleChecksAisafetyV1alphaClassifyContentResponsePolicyResult
|
229
|
+
include Google::Apis::Core::Hashable
|
230
|
+
|
231
|
+
# Type of the policy.
|
232
|
+
# Corresponds to the JSON property `policyType`
|
233
|
+
# @return [String]
|
234
|
+
attr_accessor :policy_type
|
235
|
+
|
236
|
+
# Final score for the results of this policy.
|
237
|
+
# Corresponds to the JSON property `score`
|
238
|
+
# @return [Float]
|
239
|
+
attr_accessor :score
|
240
|
+
|
241
|
+
# Result of the classification for the policy.
|
242
|
+
# Corresponds to the JSON property `violationResult`
|
243
|
+
# @return [String]
|
244
|
+
attr_accessor :violation_result
|
245
|
+
|
246
|
+
def initialize(**args)
|
247
|
+
update!(**args)
|
248
|
+
end
|
249
|
+
|
250
|
+
# Update properties of this object
|
251
|
+
def update!(**args)
|
252
|
+
@policy_type = args[:policy_type] if args.key?(:policy_type)
|
253
|
+
@score = args[:score] if args.key?(:score)
|
254
|
+
@violation_result = args[:violation_result] if args.key?(:violation_result)
|
255
|
+
end
|
256
|
+
end
|
257
|
+
|
258
|
+
# Text input to be classified.
|
259
|
+
class GoogleChecksAisafetyV1alphaTextInput
|
260
|
+
include Google::Apis::Core::Hashable
|
261
|
+
|
262
|
+
# Actual piece of text to be classified.
|
263
|
+
# Corresponds to the JSON property `content`
|
264
|
+
# @return [String]
|
265
|
+
attr_accessor :content
|
266
|
+
|
267
|
+
# Optional. Language of the text in ISO 639-1 format. If the language is invalid
|
268
|
+
# or not specified, the system will try to detect it.
|
269
|
+
# Corresponds to the JSON property `languageCode`
|
270
|
+
# @return [String]
|
271
|
+
attr_accessor :language_code
|
272
|
+
|
273
|
+
def initialize(**args)
|
274
|
+
update!(**args)
|
275
|
+
end
|
276
|
+
|
277
|
+
# Update properties of this object
|
278
|
+
def update!(**args)
|
279
|
+
@content = args[:content] if args.key?(:content)
|
280
|
+
@language_code = args[:language_code] if args.key?(:language_code)
|
281
|
+
end
|
282
|
+
end
|
283
|
+
|
105
284
|
# The request message for ReportService.AnalyzeUpload.
|
106
285
|
class GoogleChecksReportV1alphaAnalyzeUploadRequest
|
107
286
|
include Google::Apis::Core::Hashable
|
@@ -16,13 +16,13 @@ module Google
|
|
16
16
|
module Apis
|
17
17
|
module ChecksV1alpha
|
18
18
|
# Version of the google-apis-checks_v1alpha gem
|
19
|
-
GEM_VERSION = "0.
|
19
|
+
GEM_VERSION = "0.12.0"
|
20
20
|
|
21
21
|
# Version of the code generator used to generate this client
|
22
22
|
GENERATOR_VERSION = "0.15.1"
|
23
23
|
|
24
24
|
# Revision of the discovery document this client was generated from
|
25
|
-
REVISION = "
|
25
|
+
REVISION = "20241029"
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -46,6 +46,48 @@ module Google
|
|
46
46
|
include Google::Apis::Core::JsonObjectSupport
|
47
47
|
end
|
48
48
|
|
49
|
+
class GoogleChecksAisafetyV1alphaClassifyContentRequest
|
50
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
51
|
+
|
52
|
+
include Google::Apis::Core::JsonObjectSupport
|
53
|
+
end
|
54
|
+
|
55
|
+
class GoogleChecksAisafetyV1alphaClassifyContentRequestContext
|
56
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
57
|
+
|
58
|
+
include Google::Apis::Core::JsonObjectSupport
|
59
|
+
end
|
60
|
+
|
61
|
+
class GoogleChecksAisafetyV1alphaClassifyContentRequestInputContent
|
62
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
63
|
+
|
64
|
+
include Google::Apis::Core::JsonObjectSupport
|
65
|
+
end
|
66
|
+
|
67
|
+
class GoogleChecksAisafetyV1alphaClassifyContentRequestPolicyConfig
|
68
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
69
|
+
|
70
|
+
include Google::Apis::Core::JsonObjectSupport
|
71
|
+
end
|
72
|
+
|
73
|
+
class GoogleChecksAisafetyV1alphaClassifyContentResponse
|
74
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
75
|
+
|
76
|
+
include Google::Apis::Core::JsonObjectSupport
|
77
|
+
end
|
78
|
+
|
79
|
+
class GoogleChecksAisafetyV1alphaClassifyContentResponsePolicyResult
|
80
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
81
|
+
|
82
|
+
include Google::Apis::Core::JsonObjectSupport
|
83
|
+
end
|
84
|
+
|
85
|
+
class GoogleChecksAisafetyV1alphaTextInput
|
86
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
87
|
+
|
88
|
+
include Google::Apis::Core::JsonObjectSupport
|
89
|
+
end
|
90
|
+
|
49
91
|
class GoogleChecksReportV1alphaAnalyzeUploadRequest
|
50
92
|
class Representation < Google::Apis::Core::JsonRepresentation; end
|
51
93
|
|
@@ -327,6 +369,67 @@ module Google
|
|
327
369
|
end
|
328
370
|
end
|
329
371
|
|
372
|
+
class GoogleChecksAisafetyV1alphaClassifyContentRequest
|
373
|
+
# @private
|
374
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
375
|
+
property :classifier_version, as: 'classifierVersion'
|
376
|
+
property :context, as: 'context', class: Google::Apis::ChecksV1alpha::GoogleChecksAisafetyV1alphaClassifyContentRequestContext, decorator: Google::Apis::ChecksV1alpha::GoogleChecksAisafetyV1alphaClassifyContentRequestContext::Representation
|
377
|
+
|
378
|
+
property :input, as: 'input', class: Google::Apis::ChecksV1alpha::GoogleChecksAisafetyV1alphaClassifyContentRequestInputContent, decorator: Google::Apis::ChecksV1alpha::GoogleChecksAisafetyV1alphaClassifyContentRequestInputContent::Representation
|
379
|
+
|
380
|
+
collection :policies, as: 'policies', class: Google::Apis::ChecksV1alpha::GoogleChecksAisafetyV1alphaClassifyContentRequestPolicyConfig, decorator: Google::Apis::ChecksV1alpha::GoogleChecksAisafetyV1alphaClassifyContentRequestPolicyConfig::Representation
|
381
|
+
|
382
|
+
end
|
383
|
+
end
|
384
|
+
|
385
|
+
class GoogleChecksAisafetyV1alphaClassifyContentRequestContext
|
386
|
+
# @private
|
387
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
388
|
+
property :prompt, as: 'prompt'
|
389
|
+
end
|
390
|
+
end
|
391
|
+
|
392
|
+
class GoogleChecksAisafetyV1alphaClassifyContentRequestInputContent
|
393
|
+
# @private
|
394
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
395
|
+
property :text_input, as: 'textInput', class: Google::Apis::ChecksV1alpha::GoogleChecksAisafetyV1alphaTextInput, decorator: Google::Apis::ChecksV1alpha::GoogleChecksAisafetyV1alphaTextInput::Representation
|
396
|
+
|
397
|
+
end
|
398
|
+
end
|
399
|
+
|
400
|
+
class GoogleChecksAisafetyV1alphaClassifyContentRequestPolicyConfig
|
401
|
+
# @private
|
402
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
403
|
+
property :policy_type, as: 'policyType'
|
404
|
+
property :threshold, as: 'threshold'
|
405
|
+
end
|
406
|
+
end
|
407
|
+
|
408
|
+
class GoogleChecksAisafetyV1alphaClassifyContentResponse
|
409
|
+
# @private
|
410
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
411
|
+
collection :policy_results, as: 'policyResults', class: Google::Apis::ChecksV1alpha::GoogleChecksAisafetyV1alphaClassifyContentResponsePolicyResult, decorator: Google::Apis::ChecksV1alpha::GoogleChecksAisafetyV1alphaClassifyContentResponsePolicyResult::Representation
|
412
|
+
|
413
|
+
end
|
414
|
+
end
|
415
|
+
|
416
|
+
class GoogleChecksAisafetyV1alphaClassifyContentResponsePolicyResult
|
417
|
+
# @private
|
418
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
419
|
+
property :policy_type, as: 'policyType'
|
420
|
+
property :score, as: 'score'
|
421
|
+
property :violation_result, as: 'violationResult'
|
422
|
+
end
|
423
|
+
end
|
424
|
+
|
425
|
+
class GoogleChecksAisafetyV1alphaTextInput
|
426
|
+
# @private
|
427
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
428
|
+
property :content, as: 'content'
|
429
|
+
property :language_code, as: 'languageCode'
|
430
|
+
end
|
431
|
+
end
|
432
|
+
|
330
433
|
class GoogleChecksReportV1alphaAnalyzeUploadRequest
|
331
434
|
# @private
|
332
435
|
class Representation < Google::Apis::Core::JsonRepresentation
|
@@ -427,6 +427,36 @@ module Google
|
|
427
427
|
execute_or_queue_command(command, &block)
|
428
428
|
end
|
429
429
|
|
430
|
+
# Analyze a piece of content with the provided set of policies.
|
431
|
+
# @param [Google::Apis::ChecksV1alpha::GoogleChecksAisafetyV1alphaClassifyContentRequest] google_checks_aisafety_v1alpha_classify_content_request_object
|
432
|
+
# @param [String] fields
|
433
|
+
# Selector specifying which fields to include in a partial response.
|
434
|
+
# @param [String] quota_user
|
435
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
436
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
437
|
+
# @param [Google::Apis::RequestOptions] options
|
438
|
+
# Request-specific options
|
439
|
+
#
|
440
|
+
# @yield [result, err] Result & error if block supplied
|
441
|
+
# @yieldparam result [Google::Apis::ChecksV1alpha::GoogleChecksAisafetyV1alphaClassifyContentResponse] parsed result object
|
442
|
+
# @yieldparam err [StandardError] error object if request failed
|
443
|
+
#
|
444
|
+
# @return [Google::Apis::ChecksV1alpha::GoogleChecksAisafetyV1alphaClassifyContentResponse]
|
445
|
+
#
|
446
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
447
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
448
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
449
|
+
def classify_aisafety_content(google_checks_aisafety_v1alpha_classify_content_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
450
|
+
command = make_simple_command(:post, 'v1alpha/aisafety:classifyContent', options)
|
451
|
+
command.request_representation = Google::Apis::ChecksV1alpha::GoogleChecksAisafetyV1alphaClassifyContentRequest::Representation
|
452
|
+
command.request_object = google_checks_aisafety_v1alpha_classify_content_request_object
|
453
|
+
command.response_representation = Google::Apis::ChecksV1alpha::GoogleChecksAisafetyV1alphaClassifyContentResponse::Representation
|
454
|
+
command.response_class = Google::Apis::ChecksV1alpha::GoogleChecksAisafetyV1alphaClassifyContentResponse
|
455
|
+
command.query['fields'] = fields unless fields.nil?
|
456
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
457
|
+
execute_or_queue_command(command, &block)
|
458
|
+
end
|
459
|
+
|
430
460
|
# Analyzes the uploaded app bundle and returns a google.longrunning.Operation
|
431
461
|
# containing the generated Report. ## Example (upload only) Send a regular POST
|
432
462
|
# request with the header `X-Goog-Upload-Protocol: raw`. ``` POST https://checks.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-apis-checks_v1alpha
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-apis-core
|
@@ -58,7 +58,7 @@ licenses:
|
|
58
58
|
metadata:
|
59
59
|
bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
|
60
60
|
changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-checks_v1alpha/CHANGELOG.md
|
61
|
-
documentation_uri: https://googleapis.dev/ruby/google-apis-checks_v1alpha/v0.
|
61
|
+
documentation_uri: https://googleapis.dev/ruby/google-apis-checks_v1alpha/v0.12.0
|
62
62
|
source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-checks_v1alpha
|
63
63
|
post_install_message:
|
64
64
|
rdoc_options: []
|
@@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '0'
|
77
77
|
requirements: []
|
78
|
-
rubygems_version: 3.5.
|
78
|
+
rubygems_version: 3.5.21
|
79
79
|
signing_key:
|
80
80
|
specification_version: 4
|
81
81
|
summary: Simple REST client for Checks API V1alpha
|