-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from RasaHQ/cli
prepare for rasa cli
- Loading branch information
Showing
7 changed files
with
61 additions
and
46 deletions.
There are no files selected for viewing
This file contains 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 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
Empty file.
This file contains 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,32 @@ | ||
import argparse | ||
|
||
from rasa_core_sdk.constants import DEFAULT_SERVER_PORT | ||
|
||
|
||
def action_arg(action): | ||
if "/" in action: | ||
raise argparse.ArgumentTypeError( | ||
'Invalid actions format. Actions file should be a python module ' | ||
'and passed with module notation (e.g. directory.actions).') | ||
else: | ||
return action | ||
|
||
|
||
def add_endpoint_arguments(parser): | ||
parser.add_argument( | ||
'-p', '--port', | ||
default=DEFAULT_SERVER_PORT, | ||
type=int, | ||
help="port to run the server at") | ||
parser.add_argument( | ||
'--cors', | ||
nargs='*', | ||
type=str, | ||
help="enable CORS for the passed origin. " | ||
"Use * to whitelist all origins") | ||
parser.add_argument( | ||
'--actions', | ||
type=action_arg, | ||
default=None, | ||
help="name of action package to be loaded" | ||
) |
This file contains 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 @@ | ||
DEFAULT_SERVER_PORT = 5055 |
This file contains 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 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