Class: BotBaseModuleSkillModel

Inherits:
Object
  • Object
show all
Defined in:
lib/botbase-module-skillmodel.rb

Instance Method Summary collapse

Constructor Details

#initialize(file: nil, invocation: nil, userid: nil, callback: nil) ⇒ BotBaseModuleSkillModel

Returns a new instance of BotBaseModuleSkillModel.



14
15
16
17
18
19
20
21
# File 'lib/botbase-module-skillmodel.rb', line 14

def initialize(file: nil, invocation: nil, userid: nil, callback: nil)    
  
  @invocation = invocation
  amb = AlexaModelBuilder.new(File.read file)
  @skillbot = AlexaSkillSimulator.new(amb.to_manifest, amb.to_model, 
    userid: userid)
  
end

Instance Method Details

#query(sender = 'user01', msg, mode: :voicechat, echo_node: 'node1') ⇒ Object



23
24
25
# File 'lib/botbase-module-skillmodel.rb', line 23

def query(sender='user01', msg, mode: :voicechat, echo_node: 'node1')    
  @skillbot.ask 'ask ' + @invocation + ' ' + msg
end