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.
436 437 438 439 440 441 442 443 444 445 446 447 448 |
# File 'lib/google/cloud/dialogflow.rb', line 436 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 |