Class: Aws::LexRuntimeV2::EventStreams::StartConversationRequestEventStream

Inherits:
Object
  • Object
show all
Defined in:
gems/aws-sdk-lexruntimev2/lib/aws-sdk-lexruntimev2/event_streams.rb

Instance Method Summary collapse

Constructor Details

#initializeStartConversationRequestEventStream

Returns a new instance of StartConversationRequestEventStream.



14
15
16
# File 'gems/aws-sdk-lexruntimev2/lib/aws-sdk-lexruntimev2/event_streams.rb', line 14

def initialize
  @event_emitter = Aws::EventEmitter.new
end

Instance Method Details

#signal_audio_input_event_event(params = {}) ⇒ Object

Parameters:

  • params (Hash) (defaults to: {})

    a customizable set of options

Options Hash (params):

  • :audio_chunk (String, StringIO, File)

    An encoded stream of audio.

  • :content_type (String)

    The encoding used for the audio chunk. You must use 8 KHz PCM 16-bit mono-channel little-endian format. The value of the field should be:

    audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1; is-big-endian=false

  • :event_id (String)

    A unique identifier that your application assigns to the event. You can use this to identify events in logs.

  • :client_timestamp_millis (Integer)

    A timestamp set by the client of the date and time that the event was sent to Amazon Lex V2.



108
109
110
# File 'gems/aws-sdk-lexruntimev2/lib/aws-sdk-lexruntimev2/event_streams.rb', line 108

def signal_audio_input_event_event(params = {})
  @event_emitter.emit(:audio_input_event, params)
end

#signal_configuration_event_event(params = {}) ⇒ Object

Parameters:

  • params (Hash) (defaults to: {})

    a customizable set of options

Options Hash (params):

  • :request_attributes (Hash<String, String>)

    Request-specific information passed between the client application and Amazon Lex V2.

    The namespace x-amz-lex: is reserved for special attributes. Don't create any request attributes for prefix x-amz-lex:.

  • :response_content_type (String)

    The message that Amazon Lex V2 returns in the response can be either text or speech based on the responseContentType value.

    • If the value is text/plain;charset=utf-8, Amazon Lex V2 returns text in the response.

    • If the value begins with audio/, Amazon Lex V2 returns speech in the response. Amazon Lex V2 uses Amazon Polly to generate the speech using the configuration that you specified in the requestContentType parameter. For example, if you specify audio/mpeg as the value, Amazon Lex V2 returns speech in the MPEG format.

    • If the value is audio/pcm, the speech returned is audio/pcm in 16-bit, little-endian format.

    • The following are the accepted values:

      • audio/mpeg

      • audio/ogg

      • audio/pcm

      • audio/* (defaults to mpeg)

      • text/plain; charset=utf-8

  • :session_state (Types::SessionState)

    The state of the user's session with Amazon Lex V2.

  • :welcome_messages (Array<Types::Message>)

    A list of messages to send to the user.

    If you set the welcomeMessage field, you must also set the DialogAction structure's type field.

  • :disable_playback (Boolean)

    Determines whether Amazon Lex V2 should send audio responses to the client application.

    Set this field to false when the client is operating in a playback mode where audio responses are played to the user. If the client isn't operating in playback mode, such as a text chat application, set this to true so that Amazon Lex V2 doesn't wait for the prompt to finish playing on the client.

  • :event_id (String)

    A unique identifier that your application assigns to the event. You can use this to identify events in logs.

  • :client_timestamp_millis (Integer)

    A timestamp set by the client of the date and time that the event was sent to Amazon Lex V2.



86
87
88
# File 'gems/aws-sdk-lexruntimev2/lib/aws-sdk-lexruntimev2/event_streams.rb', line 86

def signal_configuration_event_event(params = {})
  @event_emitter.emit(:configuration_event, params)
end

#signal_disconnection_event_event(params = {}) ⇒ Object

Parameters:

  • params (Hash) (defaults to: {})

    a customizable set of options

Options Hash (params):

  • :event_id (String)

    A unique identifier that your application assigns to the event. You can use this to identify events in logs.

  • :client_timestamp_millis (Integer)

    A timestamp set by the client of the date and time that the event was sent to Amazon Lex V2.



164
165
166
# File 'gems/aws-sdk-lexruntimev2/lib/aws-sdk-lexruntimev2/event_streams.rb', line 164

def signal_disconnection_event_event(params = {})
  @event_emitter.emit(:disconnection_event, params)
end

#signal_dtmf_input_event_event(params = {}) ⇒ Object

Parameters:

  • params (Hash) (defaults to: {})

    a customizable set of options

Options Hash (params):

  • :input_character (String)

    The DTMF character that the user pressed. The allowed characters are A - D, 0 - 9, # and *.

  • :event_id (String)

    A unique identifier that your application assigns to the event. You can use this to identify events in logs.

  • :client_timestamp_millis (Integer)

    A timestamp set by the client of the date and time that the event was sent to Amazon Lex V2.



124
125
126
# File 'gems/aws-sdk-lexruntimev2/lib/aws-sdk-lexruntimev2/event_streams.rb', line 124

def signal_dtmf_input_event_event(params = {})
  @event_emitter.emit(:dtmf_input_event, params)
end

#signal_end_streamObject



168
169
170
# File 'gems/aws-sdk-lexruntimev2/lib/aws-sdk-lexruntimev2/event_streams.rb', line 168

def signal_end_stream
  @event_emitter.emit(:end_stream, {})
end

#signal_playback_completion_event_event(params = {}) ⇒ Object

Parameters:

  • params (Hash) (defaults to: {})

    a customizable set of options

Options Hash (params):

  • :event_id (String)

    A unique identifier that your application assigns to the event. You can use this to identify events in logs.

  • :client_timestamp_millis (Integer)

    A timestamp set by the client of the date and time that the event was sent to Amazon Lex V2.



152
153
154
# File 'gems/aws-sdk-lexruntimev2/lib/aws-sdk-lexruntimev2/event_streams.rb', line 152

def signal_playback_completion_event_event(params = {})
  @event_emitter.emit(:playback_completion_event, params)
end

#signal_text_input_event_event(params = {}) ⇒ Object

Parameters:

  • params (Hash) (defaults to: {})

    a customizable set of options

Options Hash (params):

  • :text (String)

    The text from the user. Amazon Lex V2 processes this as a complete statement.

  • :event_id (String)

    A unique identifier that your application assigns to the event. You can use this to identify events in logs.

  • :client_timestamp_millis (Integer)

    A timestamp set by the client of the date and time that the event was sent to Amazon Lex V2.



140
141
142
# File 'gems/aws-sdk-lexruntimev2/lib/aws-sdk-lexruntimev2/event_streams.rb', line 140

def signal_text_input_event_event(params = {})
  @event_emitter.emit(:text_input_event, params)
end