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.
496 497 498 499 500 501 502 503 504 505 506 507 508 |
# File 'lib/google/cloud/dialogflow.rb', line 496 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 |