Class: Google::Apis::CommentanalyzerV1alpha1::AnalyzeCommentRequest

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
generated/google/apis/commentanalyzer_v1alpha1/classes.rb,
generated/google/apis/commentanalyzer_v1alpha1/representations.rb,
generated/google/apis/commentanalyzer_v1alpha1/representations.rb

Overview

The comment analysis request message. LINT.IfChange

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Google::Apis::Core::JsonObjectSupport

#to_json

Methods included from Google::Apis::Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ AnalyzeCommentRequest

Returns a new instance of AnalyzeCommentRequest.



106
107
108
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 106

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#client_tokenString

Opaque token that is echoed from the request to the response. Corresponds to the JSON property clientToken

Returns:

  • (String)


33
34
35
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 33

def client_token
  @client_token
end

#commentGoogle::Apis::CommentanalyzerV1alpha1::TextEntry

Represents a body of text. Corresponds to the JSON property comment



38
39
40
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 38

def comment
  @comment
end

#community_idString

Optional identifier associating this AnalyzeCommentRequest with a particular client's community. Different communities may have different norms and rules. Specifying this value enables us to explore building community-specific models for clients. Corresponds to the JSON property communityId

Returns:

  • (String)


46
47
48
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 46

def community_id
  @community_id
end

#contextGoogle::Apis::CommentanalyzerV1alpha1::Context

Context is typically something that a Comment is referencing or replying to (such as an article, or previous comment). Note: Populate only ONE OF the following fields. The oneof syntax cannot be used because that would require nesting entries inside another message and breaking backwards compatibility. The server will return an error if more than one of the following fields is present. Corresponds to the JSON property context



56
57
58
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 56

def context
  @context
end

#do_not_storeBoolean Also known as: do_not_store?

Do not store the comment or context sent in this request. By default, the service may store comments/context for debugging purposes. Corresponds to the JSON property doNotStore

Returns:

  • (Boolean)


62
63
64
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 62

def do_not_store
  @do_not_store
end

#languagesArray<String>

The language(s) of the comment and context. If none are specified, we attempt to automatically detect the language. Specifying multiple languages means the text contains multiple lanugages. Both ISO and BCP-47 language codes are accepted. The server returns an error if no language was specified and language detection fails. The server also returns an error if the languages (either specified by the caller, or auto-detected) are not all supported by the service. Corresponds to the JSON property languages

Returns:

  • (Array<String>)


75
76
77
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 75

def languages
  @languages
end

#requested_attributesHash<String,Google::Apis::CommentanalyzerV1alpha1::AttributeParameters>

Specification of requested attributes. The AttributeParameters serve as configuration for each associated attribute. The map keys are attribute names. The available attributes may be different on each RFE installation, and can be seen by calling ListAttributes (see above). For the prod installation, known as Perspective API, at blade:commentanalyzer-esf and commentanalyzer.googleapis.com, see go/checker-models (internal) and https://github.com/conversationai/perspectiveapi/blob/master/api_reference.md# models. Corresponds to the JSON property requestedAttributes



88
89
90
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 88

def requested_attributes
  @requested_attributes
end

#session_idString

Session ID. Used to join related RPCs into a single session. For example, an interactive tool that calls both the AnalyzeComment and SuggestCommentScore RPCs should set all invocations of both RPCs to the same Session ID, typically a random 64-bit integer. Corresponds to the JSON property sessionId

Returns:

  • (String)


96
97
98
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 96

def session_id
  @session_id
end

#span_annotationsBoolean Also known as: span_annotations?

An advisory parameter that will return span annotations if the model is capable of providing scores with sub-comment resolution. This will likely increase the size of the returned message. Corresponds to the JSON property spanAnnotations

Returns:

  • (Boolean)


103
104
105
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 103

def span_annotations
  @span_annotations
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



111
112
113
114
115
116
117
118
119
120
121
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 111

def update!(**args)
  @client_token = args[:client_token] if args.key?(:client_token)
  @comment = args[:comment] if args.key?(:comment)
  @community_id = args[:community_id] if args.key?(:community_id)
  @context = args[:context] if args.key?(:context)
  @do_not_store = args[:do_not_store] if args.key?(:do_not_store)
  @languages = args[:languages] if args.key?(:languages)
  @requested_attributes = args[:requested_attributes] if args.key?(:requested_attributes)
  @session_id = args[:session_id] if args.key?(:session_id)
  @span_annotations = args[:span_annotations] if args.key?(:span_annotations)
end