-
Notifications
You must be signed in to change notification settings - Fork 59
3.0 // Ruby on Rails Mountable Engine #420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
emorissettegregoire
wants to merge
71
commits into
master
Choose a base branch
from
3.0-mountable
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 1 commit
Commits
Show all changes
71 commits
Select commit
Hold shift + click to select a range
c039328
Create the new engine base structure
matthewblack d3db4d6
Set up engine routes and service configurations
emorissettegregoire e392c0e
WIP - Implement Stealth.event method to support new DSL for event dec…
emorissettegregoire f39ca09
Update MIT-LICENSE
matthewblack 49e6c43
Setup a ServiceMessage
emorissettegregoire da51f07
Update copyright
emorissettegregoire fff945d
Separate routes & controllers for messages and calls
emorissettegregoire 44e848e
Ruby Versions
matthewblack dc1e144
Base Service Client
matthewblack 6a6d7f9
Add Slack Config
matthewblack 099ab0e
Move everything to base
matthewblack 3ec4057
Threads, Errors and Loggers
matthewblack f0ca069
TID belongs at module level
matthewblack 06dc82e
Refactor down to dispatcher
matthewblack 71ba312
Just change to event controller
matthewblack b8a8ae3
Refactoring down to event controller, dispatcher and a unified servic…
matthewblack 3fff994
Get rid of service call and service message. Refactor this down to se…
matthewblack 83f995b
Remove Bandwidth.
matthewblack b1a6304
require stealth/engine
emorissettegregoire babb2e6
Use single quote in base file
emorissettegregoire 9df71aa
Rename dispatch_event method to avoid potential conflicts and fix JSO…
emorissettegregoire 2b70214
Webhook subscription logic to EventController and add attributes to S…
emorissettegregoire b493b40
Add an event mapping
emorissettegregoire dd0815a
Add session file and expose convenience methods in DSL - WIP
emorissettegregoire cc88564
Update Gemfile.lock
emorissettegregoire 9ed1ca4
Define Stealth::EventContext with core methods for accessing controll…
emorissettegregoire 0480633
WIP - Add FlowManager class to support flow DSL
emorissettegregoire 252f500
Remove unused files
emorissettegregoire cb20e69
Fix trigger_flow and ensure string sanitization in say method
emorissettegregoire f63809a
Refactor - Move say method to RepliesController
emorissettegregoire 29fccd7
Add ReplyManager class to support reply DSL
emorissettegregoire 51a1a67
Added idea to gitignore
kladaFOX a9ec5a2
Added intent classifier (#425)
kladaFOX b87521a
Setup ScheduledReplyJob and handle blank flow or state for session tr…
emorissettegregoire b9278ee
commit
emorissettegregoire 78fa4ad
Fix typo in method name
emorissettegregoire e350a6b
Added ability to pass locals to step_to and update_session_to
kladaFOX 3b96aed
Merge pull request #426 from hellostealth/feature/3.0-mountable-sessi…
matthewblack b400025
Dev Jumps
matthewblack fcf625b
Remove private so we can access in rails app
matthewblack e1b4653
WIP - Add support for dropdown message types
emorissettegregoire aaab2f3
Added locals logic
kladaFOX 3d69f4d
Updated intent_classifier system prompt
kladaFOX 9a6d7a5
Refactor load_previous_locals and load_before_update_session_to_locals
kladaFOX c888055
Rename Sidekiq queues to prevent conflict with Stealth 2.0
emorissettegregoire a21e8cd
Merge branch '3.0-mountable' into feature/3.0-mountable-locals
kladaFOX 1434a46
Added ability to use thread_ts in say function
kladaFOX 1a66ba5
Persist locals
emorissettegregoire 7f3f367
Removed unnecessary persist_locals
kladaFOX 6ff701e
Added interactive_response_received event
kladaFOX b77649d
Clean up comments
matthewblack c899bc8
Remove comment
matthewblack 2bdeba8
Changed thread_ts to thread_id
kladaFOX 2ca6354
Added text_changed event
kladaFOX 1245d3b
Merge pull request #427 from hellostealth/feature/3.0-mountable-locals
matthewblack 99f5a00
Safe navigation in intent_classifier
kladaFOX 6000245
Correct if block to prevent nil intents when no categories
kladaFOX 672dddf
feature/delete-message (#428)
emorissettegregoire c554b02
Defaulting env to be Rails env (#430)
kladaFOX 1dcdc7d
Added ollama options for spectre (#436)
kladaFOX 20430ed
Fix CI specs (#441)
emorissettegregoire 711f82e
Add Bandwidth Service Support to Stealth Engine MAV-149 (#437)
emorissettegregoire 4bbe033
Temporarily fix specs
emorissettegregoire 48db83d
Add support for callback helpers and nested states in flows
emorissettegregoire e679f06
Merge pull request #445 from hellostealth/callback-helpers
matthewblack 84541b2
Remove old ubuntu-20.4
emorissettegregoire cbe2eff
Enable Hot Reloading for Flows, States, and Replies in Stealth (#446)
emorissettegregoire 4fea02c
MAV 604 Added connection_pool to stealth 3.0 (#449)
kladaFOX 74924b7
Bump Spectre to 2.0.0 (#451)
emorissettegregoire 2c24db3
Added spectre options to stealth configuration (#452)
kladaFOX 94e261e
update job queues (#453)
operand File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,9 @@ | ||
| module Stealth | ||
| class Engine < ::Rails::Engine | ||
| isolate_namespace Stealth | ||
|
|
||
| initializer 'stealth' do | ||
| require 'stealth/services/bandwidth/event_handler' | ||
| end | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| module Stealth | ||
| class EventManager | ||
| def initialize | ||
| @events = Hash.new { |hash, key| hash[key] = {} } | ||
| end | ||
|
|
||
| def register_event(event_name, &block) | ||
| @current_event = event_name | ||
| instance_eval(&block) | ||
| @current_event = nil | ||
| end | ||
|
|
||
| def on(action_name, &block) | ||
| @events[@current_event][action_name] = block | ||
| end | ||
|
|
||
| def trigger_event(event_name, action_name, request) | ||
| if @events[event_name] && @events[event_name][action_name] | ||
| @events[event_name][action_name].call(request) | ||
| else | ||
| Rails.logger.warn "No handler for #{event_name} #{action_name}" | ||
| end | ||
| end | ||
|
|
||
| def self.instance | ||
| @instance ||= new | ||
| end | ||
|
|
||
| def self.event(event_name, &block) | ||
| instance.register_event(event_name, &block) | ||
| end | ||
|
|
||
| def self.trigger_event(event_name, action_name, request) | ||
| instance.trigger_event(event_name, action_name, request) | ||
| end | ||
|
|
||
| end | ||
| end | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| module Stealth | ||
| module EventTriggers | ||
| def trigger_event(event_name, action_name, request) | ||
| EventManager.trigger_event(event_name, action_name, request) | ||
| end | ||
|
|
||
| def event(event_name, &block) | ||
| EventManager.event(event_name, &block) | ||
| end | ||
| end | ||
| end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.