Module: WitBot

Defined in:
lib/wit_bot.rb,
lib/wit_bot/version.rb,
lib/wit_bot/bot/base.rb,
lib/wit_bot/models/state.rb,
lib/wit_bot/configuration.rb,
lib/wit_bot/models/context.rb,
lib/wit_bot/models/message.rb,
lib/wit_bot/models/outcome.rb,
lib/wit_bot/models/wit/base.rb,
lib/wit_bot/errors/wit_error.rb,
lib/wit_bot/models/wit/entity.rb,
lib/wit_bot/models/wit/intent.rb,
lib/wit_bot/bot/models/message.rb,
lib/wit_bot/errors/wit_bot_error.rb,
lib/wit_bot/requests/wit_request.rb,
lib/wit_bot/bot/conversation/base.rb,
lib/wit_bot/models/message_thread.rb,
lib/wit_bot/models/wit/expression.rb,
lib/wit_bot/models/context_entities.rb,
lib/wit_bot/requests/message_request.rb,
lib/wit_bot/errors/low_confidence_error.rb,
lib/wit_bot/requests/wit_request_sender.rb,
lib/generators/wit_bot/bot/bot_generator.rb,
lib/wit_bot/bot/conversation/participant.rb,
lib/wit_bot/models/wit/intent/intent_meta.rb,
lib/wit_bot/models/wit/entity/entity_model.rb,
lib/wit_bot/models/wit/entity/entity_value.rb,
lib/wit_bot/requests/models/intents_request.rb,
lib/generators/wit_bot/model/model_generator.rb,
lib/generators/wit_bot/setup/setup_generator.rb,
lib/wit_bot/requests/models/entities_request.rb,
lib/wit_bot/requests/models/wit_model_request.rb,
lib/wit_bot/requests/models/expressions_request.rb,
lib/wit_bot/models/wit/intent/intent_expressions.rb,
lib/generators/wit_bot/message_bus/message_bus_generator.rb,
lib/generators/wit_bot/clear_conversations_job/clear_conversations_job_generator.rb

Defined Under Namespace

Modules: Bot, Generators, WitModel Classes: Configuration, Context, ContextEntities, EntitiesRequest, EntityModel, EntityModelProxy, EntityValue, Expression, ExpressionsRequest, IntentExpressions, IntentMeta, IntentsRequest, LowConfidenceError, Message, MessageRequest, MessageThread, Outcome, State, WitBotError, WitError, WitModelRequest, WitRequest, WitRequestSender

Constant Summary collapse

VERSION =
'0.5.7'

Class Method Summary collapse

Class Method Details

.configurationConfiguration Also known as: config

Returns:



9
10
11
# File 'lib/wit_bot.rb', line 9

def configuration
  @configuration ||= Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:



27
28
29
# File 'lib/wit_bot.rb', line 27

def configure
  yield configuration
end

.create_message(text) ⇒ Object



39
40
41
# File 'lib/wit_bot.rb', line 39

def create_message(text)
  thread.create_message text
end

.httpObject



31
32
33
# File 'lib/wit_bot.rb', line 31

def http
  request_sender.http
end

.loadObject



43
44
45
46
47
48
49
# File 'lib/wit_bot.rb', line 43

def load
  warn_level = $VERBOSE
  $VERBOSE = nil
  result = load_rel 'wit_bot'
  $VERBOSE = warn_level
  result
end

.request_senderObject



14
15
16
# File 'lib/wit_bot.rb', line 14

def request_sender
  @request_sender ||= WitRequestSender.new
end

.resetObject



23
24
25
# File 'lib/wit_bot.rb', line 23

def reset
  @configuration = Configuration.new
end

.reset_request_senderObject



18
19
20
21
# File 'lib/wit_bot.rb', line 18

def reset_request_sender
  @request_sender.close
  @request_sender = WitRequestSender.new
end

.threadObject



35
36
37
# File 'lib/wit_bot.rb', line 35

def thread
  MessageThread.new
end