rasa-pro 3.13.0.dev9__py3-none-any.whl → 3.13.0.dev11__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rasa-pro might be problematic. Click here for more details.
- rasa/cli/export.py +2 -0
- rasa/cli/studio/download.py +3 -9
- rasa/cli/studio/link.py +1 -2
- rasa/cli/studio/pull.py +3 -2
- rasa/cli/studio/push.py +1 -1
- rasa/cli/studio/train.py +0 -1
- rasa/core/exporter.py +36 -0
- rasa/core/policies/enterprise_search_policy.py +151 -240
- rasa/core/policies/enterprise_search_policy_config.py +242 -0
- rasa/core/policies/enterprise_search_prompt_with_relevancy_check_and_citation_template.jinja2 +6 -5
- rasa/core/utils.py +11 -2
- rasa/dialogue_understanding/commands/__init__.py +4 -0
- rasa/dialogue_understanding/generator/command_generator.py +11 -1
- rasa/dialogue_understanding/generator/prompt_templates/command_prompt_v3_claude_3_5_sonnet_20240620_template.jinja2 +78 -0
- rasa/dialogue_understanding/generator/single_step/search_ready_llm_command_generator.py +2 -2
- rasa/dialogue_understanding/processor/command_processor.py +5 -5
- rasa/shared/core/flows/validation.py +9 -2
- rasa/shared/providers/_configs/azure_openai_client_config.py +2 -2
- rasa/shared/providers/_configs/default_litellm_client_config.py +1 -1
- rasa/shared/providers/_configs/huggingface_local_embedding_client_config.py +1 -1
- rasa/shared/providers/_configs/openai_client_config.py +1 -1
- rasa/shared/providers/_configs/rasa_llm_client_config.py +1 -1
- rasa/shared/providers/_configs/self_hosted_llm_client_config.py +1 -1
- rasa/shared/providers/_configs/utils.py +0 -99
- rasa/shared/utils/configs.py +110 -0
- rasa/shared/utils/constants.py +0 -3
- rasa/shared/utils/pykwalify_extensions.py +0 -9
- rasa/studio/constants.py +1 -0
- rasa/studio/download.py +164 -0
- rasa/studio/link.py +1 -1
- rasa/studio/{download/flows.py → pull/data.py} +2 -131
- rasa/studio/{download → pull}/domains.py +1 -1
- rasa/studio/pull/pull.py +235 -0
- rasa/studio/push.py +5 -0
- rasa/studio/train.py +1 -1
- rasa/tracing/instrumentation/attribute_extractors.py +10 -5
- rasa/version.py +1 -1
- {rasa_pro-3.13.0.dev9.dist-info → rasa_pro-3.13.0.dev11.dist-info}/METADATA +1 -1
- {rasa_pro-3.13.0.dev9.dist-info → rasa_pro-3.13.0.dev11.dist-info}/RECORD +43 -40
- rasa/studio/download/download.py +0 -416
- rasa/studio/pull.py +0 -94
- /rasa/studio/{download → pull}/__init__.py +0 -0
- {rasa_pro-3.13.0.dev9.dist-info → rasa_pro-3.13.0.dev11.dist-info}/NOTICE +0 -0
- {rasa_pro-3.13.0.dev9.dist-info → rasa_pro-3.13.0.dev11.dist-info}/WHEEL +0 -0
- {rasa_pro-3.13.0.dev9.dist-info → rasa_pro-3.13.0.dev11.dist-info}/entry_points.txt +0 -0
rasa/cli/export.py
CHANGED
|
@@ -184,6 +184,7 @@ async def _export_trackers(args: argparse.Namespace) -> None:
|
|
|
184
184
|
event_broker = await _get_event_broker(endpoints)
|
|
185
185
|
_prepare_event_broker(event_broker)
|
|
186
186
|
requested_conversation_ids = _get_requested_conversation_ids(args.conversation_ids)
|
|
187
|
+
is_pii_enabled = True if endpoints.privacy else False
|
|
187
188
|
|
|
188
189
|
from rasa.core.exporter import Exporter
|
|
189
190
|
|
|
@@ -191,6 +192,7 @@ async def _export_trackers(args: argparse.Namespace) -> None:
|
|
|
191
192
|
tracker_store,
|
|
192
193
|
event_broker,
|
|
193
194
|
args.endpoints,
|
|
195
|
+
is_pii_enabled,
|
|
194
196
|
requested_conversation_ids,
|
|
195
197
|
args.minimum_timestamp,
|
|
196
198
|
args.maximum_timestamp,
|
rasa/cli/studio/download.py
CHANGED
|
@@ -4,11 +4,12 @@ from typing import List
|
|
|
4
4
|
from rasa.cli import SubParsersAction
|
|
5
5
|
from rasa.cli.arguments.default_arguments import (
|
|
6
6
|
add_config_param,
|
|
7
|
+
add_data_param,
|
|
8
|
+
add_domain_param,
|
|
7
9
|
add_endpoint_param,
|
|
8
10
|
)
|
|
9
|
-
from rasa.cli.arguments.train import add_data_param, add_domain_param
|
|
10
11
|
from rasa.shared.constants import DEFAULT_CONFIG_PATH, DEFAULT_ENDPOINTS_PATH
|
|
11
|
-
from rasa.studio.download
|
|
12
|
+
from rasa.studio.download import handle_download
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
def add_subparser(
|
|
@@ -49,13 +50,6 @@ def set_studio_download_arguments(parser: argparse.ArgumentParser) -> None:
|
|
|
49
50
|
parser.add_argument(
|
|
50
51
|
"assistant_name",
|
|
51
52
|
default=None,
|
|
52
|
-
nargs=1,
|
|
53
53
|
type=str,
|
|
54
54
|
help="Name of the assistant on Rasa Studio",
|
|
55
55
|
)
|
|
56
|
-
|
|
57
|
-
parser.add_argument(
|
|
58
|
-
"--overwrite",
|
|
59
|
-
action="store_true",
|
|
60
|
-
help="Overwrite local data with data from Rasa Studio",
|
|
61
|
-
)
|
rasa/cli/studio/link.py
CHANGED
|
@@ -2,7 +2,7 @@ import argparse
|
|
|
2
2
|
from typing import List, Text
|
|
3
3
|
|
|
4
4
|
from rasa.cli import SubParsersAction
|
|
5
|
-
from rasa.cli.
|
|
5
|
+
from rasa.cli.arguments.default_arguments import (
|
|
6
6
|
add_config_param,
|
|
7
7
|
add_data_param,
|
|
8
8
|
add_domain_param,
|
|
@@ -37,7 +37,6 @@ def add_subparser(
|
|
|
37
37
|
|
|
38
38
|
link_parser.add_argument(
|
|
39
39
|
"assistant_name",
|
|
40
|
-
nargs=1,
|
|
41
40
|
type=str,
|
|
42
41
|
help="Name of the assistant in Rasa Studio.",
|
|
43
42
|
)
|
rasa/cli/studio/pull.py
CHANGED
|
@@ -4,15 +4,16 @@ from typing import List, Text
|
|
|
4
4
|
from rasa.cli import SubParsersAction
|
|
5
5
|
from rasa.cli.arguments.default_arguments import (
|
|
6
6
|
add_config_param,
|
|
7
|
+
add_data_param,
|
|
8
|
+
add_domain_param,
|
|
7
9
|
add_endpoint_param,
|
|
8
10
|
)
|
|
9
|
-
from rasa.cli.studio.upload import add_data_param, add_domain_param
|
|
10
11
|
from rasa.shared.constants import (
|
|
11
12
|
DEFAULT_CONFIG_PATH,
|
|
12
13
|
DEFAULT_DOMAIN_PATH,
|
|
13
14
|
DEFAULT_ENDPOINTS_PATH,
|
|
14
15
|
)
|
|
15
|
-
from rasa.studio.pull import (
|
|
16
|
+
from rasa.studio.pull.pull import (
|
|
16
17
|
handle_pull,
|
|
17
18
|
handle_pull_config,
|
|
18
19
|
handle_pull_endpoints,
|
rasa/cli/studio/push.py
CHANGED
rasa/cli/studio/train.py
CHANGED
rasa/core/exporter.py
CHANGED
|
@@ -16,6 +16,11 @@ from rasa.exceptions import (
|
|
|
16
16
|
NoEventsToMigrateError,
|
|
17
17
|
PublishingError,
|
|
18
18
|
)
|
|
19
|
+
from rasa.shared.core.events import (
|
|
20
|
+
BotUttered,
|
|
21
|
+
SlotSet,
|
|
22
|
+
UserUttered,
|
|
23
|
+
)
|
|
19
24
|
from rasa.shared.core.trackers import EventVerbosity
|
|
20
25
|
|
|
21
26
|
logger = logging.getLogger(__name__)
|
|
@@ -43,6 +48,7 @@ class Exporter:
|
|
|
43
48
|
tracker_store: TrackerStore,
|
|
44
49
|
event_broker: EventBroker,
|
|
45
50
|
endpoints_path: Text,
|
|
51
|
+
is_pii_enabled: bool = False,
|
|
46
52
|
requested_conversation_ids: Optional[Text] = None,
|
|
47
53
|
minimum_timestamp: Optional[float] = None,
|
|
48
54
|
maximum_timestamp: Optional[float] = None,
|
|
@@ -52,6 +58,7 @@ class Exporter:
|
|
|
52
58
|
self.tracker_store = tracker_store
|
|
53
59
|
|
|
54
60
|
self.event_broker = event_broker
|
|
61
|
+
self.is_pii_enabled = is_pii_enabled
|
|
55
62
|
self.requested_conversation_ids = requested_conversation_ids
|
|
56
63
|
self.minimum_timestamp = minimum_timestamp
|
|
57
64
|
self.maximum_timestamp = maximum_timestamp
|
|
@@ -72,10 +79,12 @@ class Exporter:
|
|
|
72
79
|
current_timestamp = None
|
|
73
80
|
|
|
74
81
|
headers = self._get_message_headers()
|
|
82
|
+
warned_sender_ids: Set[Text] = set()
|
|
75
83
|
|
|
76
84
|
async for event in self._fetch_events_within_time_range():
|
|
77
85
|
# noinspection PyBroadException
|
|
78
86
|
try:
|
|
87
|
+
self._check_anonymization_status(event, warned_sender_ids)
|
|
79
88
|
self._publish_with_message_headers(event, headers)
|
|
80
89
|
published_events += 1
|
|
81
90
|
current_timestamp = event["timestamp"]
|
|
@@ -282,3 +291,30 @@ class Exporter:
|
|
|
282
291
|
events_with_conversation_id.append(event)
|
|
283
292
|
|
|
284
293
|
return events_with_conversation_id
|
|
294
|
+
|
|
295
|
+
def _check_anonymization_status(
|
|
296
|
+
self, event: Dict[Text, Any], warned_sender_ids: Set[Text]
|
|
297
|
+
) -> None:
|
|
298
|
+
"""Check if the tracker store contains unanonymized events.
|
|
299
|
+
|
|
300
|
+
If it does, print a warning that these events will be published as is.
|
|
301
|
+
|
|
302
|
+
Args:
|
|
303
|
+
event: The event to check for anonymization status
|
|
304
|
+
warned_sender_ids: Set of sender IDs that have already been warned about
|
|
305
|
+
"""
|
|
306
|
+
sender_id = event["sender_id"]
|
|
307
|
+
if (
|
|
308
|
+
self.is_pii_enabled
|
|
309
|
+
and sender_id not in warned_sender_ids
|
|
310
|
+
and event["event"]
|
|
311
|
+
in (UserUttered.type_name, BotUttered.type_name, SlotSet.type_name)
|
|
312
|
+
and not event.get("anonymized_at", None)
|
|
313
|
+
):
|
|
314
|
+
rasa.shared.utils.cli.print_warning(
|
|
315
|
+
f"Retrieved un-anonymized event for sender_id {sender_id}. "
|
|
316
|
+
f"All events after this timestamp {event['timestamp']} "
|
|
317
|
+
"are not anonymized for this tracker. Proceeding with "
|
|
318
|
+
"publishing plaintext values for all events following this.",
|
|
319
|
+
)
|
|
320
|
+
warned_sender_ids.add(sender_id)
|