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.
504 505 506 507 508 509 510 511 512 513 514 515 516 |
# File 'lib/google/cloud/dialogflow.rb', line 504 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 |