diff --git a/pyproject.toml b/pyproject.toml index a0a5d160f10b..5bccf33762ad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ repository = "https://github.com/rasahq/rasa" documentation = "https://rasa.com/docs" classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Topic :: Software Development :: Libraries",] keywords = [ "nlp", "machine-learning", "machine-learning-library", "bot", "bots", "botkit", "rasa conversational-agents", "conversational-ai", "chatbot", "chatbot-framework", "bot-framework",] -include = [ "LICENSE.txt", "README.md", "rasa/shared/core/training_data/visualization.html", "rasa/cli/default_config.yml", "rasa/shared/importers/*", "rasa/utils/schemas/*", "rasa/keys", "rasa/core/channels/chat.html", "rasa/dialogue_understanding/classifiers/command_prompt_template.jinja2",] +include = [ "LICENSE.txt", "README.md", "rasa/shared/core/training_data/visualization.html", "rasa/cli/default_config.yml", "rasa/shared/importers/*", "rasa/utils/schemas/*", "rasa/keys", "rasa/dialogue_understanding/classifiers/command_prompt_template.jinja2",] readme = "README.md" [[tool.poetry.source]] name = "internal repository mirroring psycopg binary for macos" diff --git a/rasa/__main__.py b/rasa/__main__.py index 0c9a0c86bd41..2132e9027c99 100644 --- a/rasa/__main__.py +++ b/rasa/__main__.py @@ -13,7 +13,6 @@ import rasa.utils.tensorflow.environment as tf_env from rasa import version from rasa.cli import ( - chat, data, export, interactive, @@ -64,7 +63,6 @@ def create_argument_parser() -> argparse.ArgumentParser: scaffold.add_subparser(subparsers, parents=parent_parsers) run.add_subparser(subparsers, parents=parent_parsers) shell.add_subparser(subparsers, parents=parent_parsers) - chat.add_subparser(subparsers, parents=parent_parsers) train.add_subparser(subparsers, parents=parent_parsers) interactive.add_subparser(subparsers, parents=parent_parsers) telemetry.add_subparser(subparsers, parents=parent_parsers) diff --git a/rasa/cli/chat.py b/rasa/cli/chat.py deleted file mode 100644 index 83b2bf0cf9af..000000000000 --- a/rasa/cli/chat.py +++ /dev/null @@ -1,69 +0,0 @@ -import argparse -from asyncio import AbstractEventLoop -import logging -from typing import List, Text -import uuid -import webbrowser - -from sanic import Sanic - -from rasa.cli import SubParsersAction -from rasa.cli.arguments import shell as arguments -from rasa.core import constants - -logger = logging.getLogger(__name__) - - -def add_subparser( - subparsers: SubParsersAction, parents: List[argparse.ArgumentParser] -) -> None: - """Add all chat parsers. - - Args: - subparsers: subparser we are going to attach to - parents: Parent parsers, needed to ensure tree structure in argparse - """ - chat_parser = subparsers.add_parser( - "chat", - parents=parents, - conflict_handler="resolve", - formatter_class=argparse.ArgumentDefaultsHelpFormatter, - help=( - "Loads your trained model and lets you talk to your " - "assistant in the browser." - ), - ) - chat_parser.set_defaults(func=chat) - - chat_parser.add_argument( - "--conversation-id", - default=uuid.uuid4().hex, - required=False, - help="Set the conversation ID.", - ) - - arguments.set_shell_arguments(chat_parser) - chat_parser.set_defaults(enable_api=True) - - -async def open_chat_in_browser(server_url: Text) -> None: - """Opens the rasa chat in the default browser.""" - webbrowser.open(f"{server_url}/webhooks/socketio/chat.html") - - -def chat(args: argparse.Namespace) -> None: - """Chat to the bot using the most recent model.""" - import rasa.cli.run - - args.connector = "socketio" - - logging.getLogger("rasa.core.tracker_store").setLevel(logging.INFO) - - async def after_start_hook_open_chat(_: Sanic, __: AbstractEventLoop) -> None: - """Hook to open the browser on server start.""" - server_url = constants.DEFAULT_SERVER_FORMAT.format("http", args.port) - await open_chat_in_browser(server_url) - - args.server_listeners = [(after_start_hook_open_chat, "after_server_start")] - - rasa.cli.run.run(args) diff --git a/rasa/core/channels/chat.html b/rasa/core/channels/chat.html deleted file mode 100644 index c7f299da3405..000000000000 --- a/rasa/core/channels/chat.html +++ /dev/null @@ -1,429 +0,0 @@ - - -
- -- You can include the chat on your own website using the following code - (rasa documentation): -
--<div id="rasa-chat-widget" data-websocket-url="https://example.com/"></div> -<script src="https://unpkg.com/@rasahq/rasa-chat" type="application/javascript"></script> --
Stack (top is active):
-ID | -Flow | -Step Id | -
---|
Slots:
-Slot | -Value | -
---|
End-2-End Test:
-No test yet
- Tracker State:
-No story yet
- Current Flow:
-