Module: VoiceBase::V3::Response
- Defined in:
- lib/voicebase/v3/response.rb
Constant Summary collapse
- TRANSCRIPT_READY_STATUS =
"finished".freeze
Instance Method Summary collapse
- #keywords ⇒ Object
- #media_id ⇒ Object
- #success? ⇒ Boolean
- #topics ⇒ Object
- #transcript ⇒ Object
- #transcript_ready? ⇒ Boolean
Instance Method Details
#keywords ⇒ Object
25 26 27 |
# File 'lib/voicebase/v3/response.rb', line 25 def keywords knowledge["keywords"] end |
#media_id ⇒ Object
11 12 13 |
# File 'lib/voicebase/v3/response.rb', line 11 def media_id voicebase_response['mediaId'] end |
#success? ⇒ Boolean
7 8 9 |
# File 'lib/voicebase/v3/response.rb', line 7 def success? ok? end |
#topics ⇒ Object
29 30 31 |
# File 'lib/voicebase/v3/response.rb', line 29 def topics knowledge['topics'] end |
#transcript ⇒ Object
19 20 21 22 23 |
# File 'lib/voicebase/v3/response.rb', line 19 def transcript # this retrieves the JSON transcript only # the plain text transcript is a plain text non-JSON response voicebase_response['transcript']['words'] end |
#transcript_ready? ⇒ Boolean
15 16 17 |
# File 'lib/voicebase/v3/response.rb', line 15 def transcript_ready? voicebase_response['status'].downcase == TRANSCRIPT_READY_STATUS end |