Module: Google::Cloud::Dialogflow::Sessions
- Defined in:
- lib/google/cloud/dialogflow.rb
Class Method Summary collapse
-
.new(version: , credentials: , scopes: , client_config: , timeout: ) ⇒ Object
A session represents an interaction with a user.
Class Method Details
.new(version: , credentials: , scopes: , client_config: , timeout: ) ⇒ Object
A session represents an interaction with a user. You retrieve user input and pass it to the DetectIntent (or StreamingDetectIntent) method to determine user intent and respond.
528 529 530 531 532 533 534 535 536 537 538 539 540 |
# File 'lib/google/cloud/dialogflow.rb', line 528 def self.new(*args, version: :v2, **kwargs) unless AVAILABLE_VERSIONS.include?(version.to_s.downcase) raise "The version: #{version} is not available. The available versions " \ "are: [#{AVAILABLE_VERSIONS.join(", ")}]" end require "#{FILE_DIR}/#{version.to_s.downcase}" version_module = Google::Cloud::Dialogflow .constants .select {|sym| sym.to_s.downcase == version.to_s.downcase} .first Google::Cloud::Dialogflow.const_get(version_module)::Sessions.new(*args, **kwargs) end |