Skip to content

Commit

Permalink
v3.3.1 - fixed recursive call for actions + ensure context type
Browse files Browse the repository at this point in the history
  • Loading branch information
patapizza committed Apr 18, 2016
1 parent e380650 commit d20e5cd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## v3.3.1

- fixed recursive call when running actions
- throws an exception if context passed is not a Hash

## v3.3

Unifying action parameters
Expand Down
4 changes: 3 additions & 1 deletion lib/wit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def message(msg)
end

def converse(session_id, msg, context={})
raise WitException.new 'context should be a Hash' unless context.is_a? Hash
params = {}
params[:q] = msg unless msg.nil?
params[:session_id] = session_id
Expand Down Expand Up @@ -116,10 +117,11 @@ def run_actions_(session_id, message, context, max_steps, user_message)
else
raise WitException.new "unknown type: #{type}"
end
return run_actions session_id, nil, context, max_steps - 1
return run_actions_ session_id, nil, context, max_steps - 1, user_message
end

def run_actions(session_id, message, context={}, max_steps=DEFAULT_MAX_STEPS)
raise WitException.new 'context should be a Hash' unless context.is_a? Hash
return run_actions_ session_id, message, context, max_steps, message
end

Expand Down
2 changes: 1 addition & 1 deletion wit.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'wit'
s.version = '3.3.0'
s.version = '3.3.1'
s.date = Date.today.to_s
s.summary = 'Ruby SDK for Wit.ai'
s.description = 'Ruby SDK for Wit.ai'
Expand Down

1 comment on commit d20e5cd

@patapizza
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#5

Please sign in to comment.