This repository has been archived by the owner on Aug 22, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1k
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 #1743 from RasaHQ/rasa-cli
Rasa cli
- Loading branch information
Showing
36 changed files
with
1,178 additions
and
1,073 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
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
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
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 |
---|---|---|
@@ -1,9 +1,5 @@ | ||
import rasa_core.cli.arguments | ||
from rasa_core import utils | ||
|
||
|
||
def stories_from_cli_args(cmdline_arguments): | ||
if cmdline_arguments.url: | ||
return utils.download_file_from_url(cmdline_arguments.url) | ||
else: | ||
return cmdline_arguments.stories | ||
import rasa_core.cli.test | ||
import rasa_core.cli.run | ||
import rasa_core.cli.train | ||
import rasa_core.cli.visualization |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
from rasa_core import constants | ||
|
||
|
||
def add_run_arguments(parser): | ||
server_arguments = parser.add_argument_group("Server Settings") | ||
server_arguments.add_argument( | ||
'-p', '--port', | ||
default=constants.DEFAULT_SERVER_PORT, | ||
type=int, | ||
help="port to run the server at") | ||
server_arguments.add_argument( | ||
'--auth_token', | ||
type=str, | ||
help="Enable token based authentication. Requests need to provide " | ||
"the token to be accepted.") | ||
server_arguments.add_argument( | ||
'--cors', | ||
nargs='*', | ||
type=str, | ||
help="enable CORS for the passed origin. " | ||
"Use * to whitelist all origins") | ||
server_arguments.add_argument( | ||
'--enable_api', | ||
action="store_true", | ||
help="Start the web server api in addition to the input channel") | ||
|
||
parser.add_argument( | ||
'-o', '--log_file', | ||
type=str, | ||
default="rasa_core.log", | ||
help="store log file in specified file") | ||
channel_arguments = parser.add_argument_group("Channels") | ||
channel_arguments.add_argument( | ||
'--credentials', | ||
default=None, | ||
help="authentication credentials for the connector as a yml file") | ||
channel_arguments.add_argument( | ||
'-c', '--connector', | ||
type=str, | ||
help="service to connect to") | ||
parser.add_argument( | ||
'--endpoints', | ||
default=None, | ||
help="Configuration file for the connectors as a yml file") | ||
|
||
jwt_auth = parser.add_argument_group('JWT Authentication') | ||
jwt_auth.add_argument( | ||
'--jwt_secret', | ||
type=str, | ||
help="Public key for asymmetric JWT methods or shared secret" | ||
"for symmetric methods. Please also make sure to use " | ||
"--jwt_method to select the method of the signature, " | ||
"otherwise this argument will be ignored.") | ||
jwt_auth.add_argument( | ||
'--jwt_method', | ||
type=str, | ||
default="HS256", | ||
help="Method used for the signature of the JWT authentication " | ||
"payload.") |
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,35 @@ | ||
from rasa_core.cli import arguments | ||
|
||
|
||
def add_evaluation_arguments(parser): | ||
parser.add_argument( | ||
'-m', '--max_stories', | ||
type=int, | ||
help="maximum number of stories to test on") | ||
parser.add_argument( | ||
'-u', '--nlu', | ||
type=str, | ||
help="nlu model to run with the server. None for regex interpreter") | ||
parser.add_argument( | ||
'-o', '--output', | ||
type=str, | ||
default="results", | ||
help="output path for the any files created from the evaluation") | ||
parser.add_argument( | ||
'--e2e', '--end-to-end', | ||
action='store_true', | ||
help="Run an end-to-end evaluation for combined action and " | ||
"intent prediction. Requires a story file in end-to-end " | ||
"format.") | ||
parser.add_argument( | ||
'--endpoints', | ||
default=None, | ||
help="Configuration file for the connectors as a yml file") | ||
parser.add_argument( | ||
'--fail_on_prediction_errors', | ||
action='store_true', | ||
help="If a prediction error is encountered, an exception " | ||
"is thrown. This can be used to validate stories during " | ||
"tests, e.g. on travis.") | ||
|
||
arguments.add_core_model_arg(parser) |
Oops, something went wrong.