Class: Google::Apis::DialogflowV2::GoogleCloudDialogflowV2AnnotatedMessagePart

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

Overview

Represents a part of a message possibly annotated with an entity. The part can be an entity or purely a part of the message between two entities or message start/end.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ GoogleCloudDialogflowV2AnnotatedMessagePart

Returns a new instance of GoogleCloudDialogflowV2AnnotatedMessagePart.



166
167
168
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 166

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

Instance Attribute Details

#entity_typeString

The Dialogflow system entity type of this message part. If this is empty, Dialogflow could not annotate the phrase part with a system entity. Corresponds to the JSON property entityType

Returns:

  • (String)


145
146
147
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 145

def entity_type
  @entity_type
end

#formatted_valueObject

The Dialogflow system entity formatted value of this message part. For example for a system entity of type @sys.unit-currency, this may contain:


`
"amount": 5,
"currency": "USD"
`

Corresponds to the JSON property formattedValue

Returns:

  • (Object)


159
160
161
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 159

def formatted_value
  @formatted_value
end

#textString

A part of a message possibly annotated with an entity. Corresponds to the JSON property text

Returns:

  • (String)


164
165
166
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 164

def text
  @text
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



171
172
173
174
175
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 171

def update!(**args)
  @entity_type = args[:entity_type] if args.key?(:entity_type)
  @formatted_value = args[:formatted_value] if args.key?(:formatted_value)
  @text = args[:text] if args.key?(:text)
end