rasa-pro 3.14.0a17__py3-none-any.whl → 3.14.0a19__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/builder/main.py +5 -14
- rasa/builder/project_generator.py +1 -1
- rasa/builder/template_cache.py +9 -184
- rasa/core/concurrent_lock_store.py +66 -16
- rasa/model_manager/warm_rasa_process.py +13 -2
- rasa/version.py +1 -1
- {rasa_pro-3.14.0a17.dist-info → rasa_pro-3.14.0a19.dist-info}/METADATA +2 -1
- {rasa_pro-3.14.0a17.dist-info → rasa_pro-3.14.0a19.dist-info}/RECORD +11 -11
- {rasa_pro-3.14.0a17.dist-info → rasa_pro-3.14.0a19.dist-info}/NOTICE +0 -0
- {rasa_pro-3.14.0a17.dist-info → rasa_pro-3.14.0a19.dist-info}/WHEEL +0 -0
- {rasa_pro-3.14.0a17.dist-info → rasa_pro-3.14.0a19.dist-info}/entry_points.txt +0 -0
rasa/builder/main.py
CHANGED
|
@@ -22,11 +22,9 @@ from rasa.builder.logging_utils import (
|
|
|
22
22
|
log_request_start,
|
|
23
23
|
)
|
|
24
24
|
from rasa.builder.service import bp, setup_project_generator
|
|
25
|
-
from rasa.builder.template_cache import (
|
|
26
|
-
background_download_template_caches,
|
|
27
|
-
)
|
|
28
25
|
from rasa.builder.training_service import try_load_existing_agent, update_agent
|
|
29
26
|
from rasa.core.channels.studio_chat import StudioChatInput
|
|
27
|
+
from rasa.model_manager.warm_rasa_process import warmup
|
|
30
28
|
from rasa.server import configure_cors
|
|
31
29
|
from rasa.utils.common import configure_logging_and_warnings
|
|
32
30
|
from rasa.utils.log_utils import configure_structlog
|
|
@@ -150,16 +148,6 @@ def create_app(project_folder: str) -> Sanic:
|
|
|
150
148
|
except Exception as e:
|
|
151
149
|
structlogger.warning("Failed to load agent on server startup", error=str(e))
|
|
152
150
|
|
|
153
|
-
if config.HELLO_RASA_PROJECT_ID and app.ctx.project_generator.is_empty():
|
|
154
|
-
app.register_listener(background_download_template_caches, "after_server_start")
|
|
155
|
-
else:
|
|
156
|
-
structlogger.debug(
|
|
157
|
-
"builder.main.background_cache_download.disabled",
|
|
158
|
-
event_info=(
|
|
159
|
-
"No hello rasa project id set; skipping background cache download"
|
|
160
|
-
),
|
|
161
|
-
)
|
|
162
|
-
|
|
163
151
|
return app
|
|
164
152
|
|
|
165
153
|
|
|
@@ -200,9 +188,12 @@ def main(project_folder: Optional[str] = None) -> None:
|
|
|
200
188
|
rasa.telemetry.initialize_telemetry()
|
|
201
189
|
rasa.telemetry.initialize_error_reporting(private_mode=False)
|
|
202
190
|
|
|
203
|
-
# TODO: don't do this when running locally
|
|
204
191
|
_apply_llm_overrides_from_builder_env()
|
|
205
192
|
|
|
193
|
+
if config.HELLO_RASA_PROJECT_ID:
|
|
194
|
+
# ensures long import times for modules are ahead of time
|
|
195
|
+
warmup()
|
|
196
|
+
|
|
206
197
|
# working directory needs to be the project folder, e.g.
|
|
207
198
|
# for relative paths (./docs) in a projects config to work
|
|
208
199
|
if not project_folder:
|
|
@@ -62,7 +62,7 @@ class ProjectGenerator:
|
|
|
62
62
|
create_initial_project(self.project_folder.as_posix(), template)
|
|
63
63
|
# If a local cache for this template exists, copy it into the project.
|
|
64
64
|
# We no longer download here to avoid blocking project creation.
|
|
65
|
-
copy_cache_for_template_if_available(template, self.project_folder)
|
|
65
|
+
await copy_cache_for_template_if_available(template, self.project_folder)
|
|
66
66
|
# needs to happen after caching, as we download/copy .rasa and that would
|
|
67
67
|
# overwrite the project info file in .rasa
|
|
68
68
|
ensure_first_used(self.project_folder)
|
rasa/builder/template_cache.py
CHANGED
|
@@ -1,83 +1,26 @@
|
|
|
1
|
-
import asyncio
|
|
2
1
|
import os
|
|
3
|
-
import shutil
|
|
4
|
-
import tarfile
|
|
5
|
-
import tempfile
|
|
6
2
|
from pathlib import Path
|
|
7
|
-
from typing import Generator
|
|
8
3
|
|
|
9
4
|
import aiofiles
|
|
10
|
-
import
|
|
5
|
+
import aiofiles.os
|
|
6
|
+
import aioshutil
|
|
11
7
|
import structlog
|
|
12
|
-
from sanic import Sanic
|
|
13
8
|
|
|
14
|
-
import rasa.version
|
|
15
|
-
from rasa.builder.logging_utils import capture_exception_with_context
|
|
16
9
|
from rasa.cli.scaffold import ProjectTemplateName
|
|
17
10
|
|
|
18
11
|
structlogger = structlog.get_logger()
|
|
19
12
|
|
|
20
|
-
CACHE_BUCKET_URL = "https://trained-templates.s3.us-east-1.amazonaws.com"
|
|
21
13
|
|
|
22
14
|
# Root directory for storing downloaded template caches on disk.
|
|
23
|
-
_CACHE_ROOT_DIR = Path(
|
|
24
|
-
os.getenv(
|
|
25
|
-
"RASA_TEMPLATE_CACHE_DIR",
|
|
26
|
-
Path.home().joinpath(".rasa", "template-cache").as_posix(),
|
|
27
|
-
)
|
|
28
|
-
)
|
|
15
|
+
_CACHE_ROOT_DIR = Path(os.getenv("RASA_TEMPLATE_CACHE_DIR", "/templates"))
|
|
29
16
|
|
|
30
17
|
|
|
31
18
|
def _template_cache_dir(template: ProjectTemplateName) -> Path:
|
|
32
19
|
"""Return the local cache directory for a given template and version."""
|
|
33
|
-
return _CACHE_ROOT_DIR /
|
|
20
|
+
return _CACHE_ROOT_DIR / template.value
|
|
34
21
|
|
|
35
22
|
|
|
36
|
-
def
|
|
37
|
-
return Path(
|
|
38
|
-
os.getenv(
|
|
39
|
-
"RASA_TEMPLATE_CACHE_DIR",
|
|
40
|
-
Path.home().joinpath(".rasa", "template-cache").as_posix(),
|
|
41
|
-
)
|
|
42
|
-
)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
def _safe_tar_members(
|
|
46
|
-
tar: tarfile.TarFile, destination_directory: Path
|
|
47
|
-
) -> Generator[tarfile.TarInfo, None, None]:
|
|
48
|
-
"""Yield safe members for extraction to prevent path traversal and links.
|
|
49
|
-
|
|
50
|
-
Args:
|
|
51
|
-
tar: Open tar file handle
|
|
52
|
-
destination_directory: Directory to which files will be extracted
|
|
53
|
-
|
|
54
|
-
Yields:
|
|
55
|
-
Members that are safe to extract within destination_directory
|
|
56
|
-
"""
|
|
57
|
-
base_path = destination_directory.resolve()
|
|
58
|
-
|
|
59
|
-
for member in tar.getmembers():
|
|
60
|
-
name = member.name
|
|
61
|
-
# Skip empty names and absolute paths
|
|
62
|
-
if not name or name.startswith("/") or name.startswith("\\"):
|
|
63
|
-
continue
|
|
64
|
-
|
|
65
|
-
# Disallow symlinks and hardlinks
|
|
66
|
-
if member.issym() or member.islnk():
|
|
67
|
-
continue
|
|
68
|
-
|
|
69
|
-
# Compute the final path and ensure it's within base_path
|
|
70
|
-
target_path = (base_path / name).resolve()
|
|
71
|
-
try:
|
|
72
|
-
target_path.relative_to(base_path)
|
|
73
|
-
except ValueError:
|
|
74
|
-
# Member would escape the destination directory
|
|
75
|
-
continue
|
|
76
|
-
|
|
77
|
-
yield member
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
def _copytree(src: Path, dst: Path) -> None:
|
|
23
|
+
async def _copytree(src: Path, dst: Path) -> None:
|
|
81
24
|
"""Copy directory tree from src to dst, merging into dst.
|
|
82
25
|
|
|
83
26
|
Existing files are overwritten. Hidden files and directories are included, as
|
|
@@ -87,132 +30,14 @@ def _copytree(src: Path, dst: Path) -> None:
|
|
|
87
30
|
for root, dirs, files in os.walk(src):
|
|
88
31
|
rel_path = Path(root).relative_to(src)
|
|
89
32
|
target_dir = dst / rel_path
|
|
90
|
-
|
|
33
|
+
await aiofiles.os.makedirs(target_dir, exist_ok=True)
|
|
91
34
|
for filename in files:
|
|
92
35
|
src_file = Path(root) / filename
|
|
93
36
|
dst_file = target_dir / filename
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
async def download_cache_for_template(
|
|
98
|
-
template: ProjectTemplateName, target_dir: str
|
|
99
|
-
) -> None:
|
|
100
|
-
# get a temp path for the cache file download
|
|
101
|
-
temporary_cache_file = tempfile.NamedTemporaryFile(suffix=".tar.gz", delete=False)
|
|
102
|
-
|
|
103
|
-
try:
|
|
104
|
-
url = f"{CACHE_BUCKET_URL}/{rasa.version.__version__}-{template.value}.tar.gz"
|
|
105
|
-
async with aiohttp.ClientSession() as session:
|
|
106
|
-
async with session.get(url) as response:
|
|
107
|
-
response.raise_for_status()
|
|
108
|
-
async with aiofiles.open(temporary_cache_file.name, "wb") as f:
|
|
109
|
-
async for chunk in response.content.iter_chunked(1024 * 1024):
|
|
110
|
-
await f.write(chunk)
|
|
111
|
-
|
|
112
|
-
# extract the cache to the project folder using safe member filtering
|
|
113
|
-
with tarfile.open(temporary_cache_file.name, "r:gz") as tar:
|
|
114
|
-
destination = Path(target_dir)
|
|
115
|
-
destination.mkdir(parents=True, exist_ok=True)
|
|
116
|
-
tar.extractall(
|
|
117
|
-
path=destination,
|
|
118
|
-
members=_safe_tar_members(tar, destination),
|
|
119
|
-
)
|
|
120
|
-
|
|
121
|
-
structlogger.info(
|
|
122
|
-
"project_generator.download_cache_for_template.success",
|
|
123
|
-
template=template,
|
|
124
|
-
event_info=(
|
|
125
|
-
"Downloaded cache for template, extracted to target directory."
|
|
126
|
-
),
|
|
127
|
-
target_dir=target_dir,
|
|
128
|
-
)
|
|
129
|
-
except aiohttp.ClientResponseError as e:
|
|
130
|
-
if e.status == 403:
|
|
131
|
-
structlogger.debug(
|
|
132
|
-
"project_generator.download_cache_for_template.no_cache_found",
|
|
133
|
-
template=template,
|
|
134
|
-
event_info=("No cache found for template, continuing without it."),
|
|
135
|
-
target_dir=target_dir,
|
|
136
|
-
)
|
|
137
|
-
else:
|
|
138
|
-
capture_exception_with_context(
|
|
139
|
-
e,
|
|
140
|
-
"project_generator.download_cache_for_template.response_error",
|
|
141
|
-
extra={
|
|
142
|
-
"template": template.value,
|
|
143
|
-
"status": str(e.status),
|
|
144
|
-
"target_dir": target_dir,
|
|
145
|
-
},
|
|
146
|
-
)
|
|
147
|
-
except Exception as exc:
|
|
148
|
-
capture_exception_with_context(
|
|
149
|
-
exc,
|
|
150
|
-
"project_generator.download_cache_for_template.unexpected_error",
|
|
151
|
-
extra={"template": template.value, "target_dir": target_dir},
|
|
152
|
-
)
|
|
153
|
-
finally:
|
|
154
|
-
# Clean up the temporary file
|
|
155
|
-
try:
|
|
156
|
-
Path(temporary_cache_file.name).unlink(missing_ok=True)
|
|
157
|
-
except Exception as exc:
|
|
158
|
-
structlogger.debug(
|
|
159
|
-
"project_generator.download_cache_for_template.cleanup_error",
|
|
160
|
-
error=str(exc),
|
|
161
|
-
template=template,
|
|
162
|
-
event_info=("Failed to cleanup cache for template, ignoring."),
|
|
163
|
-
)
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
async def background_download_template_caches(
|
|
167
|
-
app: Sanic, loop: asyncio.AbstractEventLoop
|
|
168
|
-
) -> None:
|
|
169
|
-
"""Kick off background downloads of template caches if enabled."""
|
|
170
|
-
try:
|
|
171
|
-
structlogger.info(
|
|
172
|
-
"builder.main.background_cache_download.start",
|
|
173
|
-
event_info=(
|
|
174
|
-
"Starting background download of template caches for this " "version"
|
|
175
|
-
),
|
|
176
|
-
)
|
|
177
|
-
|
|
178
|
-
# Ensure cache root exists
|
|
179
|
-
_cache_root_dir().mkdir(parents=True, exist_ok=True)
|
|
180
|
-
|
|
181
|
-
async def _download(template: ProjectTemplateName) -> None:
|
|
182
|
-
try:
|
|
183
|
-
target_dir = _template_cache_dir(template)
|
|
184
|
-
if target_dir.exists() and any(target_dir.iterdir()):
|
|
185
|
-
structlogger.debug(
|
|
186
|
-
"builder.main.background_cache_download.skipped",
|
|
187
|
-
template=template,
|
|
188
|
-
event_info=(
|
|
189
|
-
"Skipping download of template cache because it "
|
|
190
|
-
"already exists."
|
|
191
|
-
),
|
|
192
|
-
target_dir=target_dir,
|
|
193
|
-
)
|
|
194
|
-
return
|
|
195
|
-
|
|
196
|
-
target_dir.mkdir(parents=True, exist_ok=True)
|
|
197
|
-
await download_cache_for_template(template, target_dir.as_posix())
|
|
198
|
-
except Exception as exc:
|
|
199
|
-
structlogger.debug(
|
|
200
|
-
"builder.main.background_cache_download.error",
|
|
201
|
-
template=template,
|
|
202
|
-
error=str(exc),
|
|
203
|
-
)
|
|
204
|
-
|
|
205
|
-
# schedule downloads concurrently without blocking startup
|
|
206
|
-
for template in ProjectTemplateName:
|
|
207
|
-
loop.create_task(_download(template))
|
|
208
|
-
except Exception as exc:
|
|
209
|
-
structlogger.debug(
|
|
210
|
-
"builder.main.background_cache_download.unexpected_error",
|
|
211
|
-
error=str(exc),
|
|
212
|
-
)
|
|
37
|
+
await aioshutil.copy2(src_file, dst_file)
|
|
213
38
|
|
|
214
39
|
|
|
215
|
-
def copy_cache_for_template_if_available(
|
|
40
|
+
async def copy_cache_for_template_if_available(
|
|
216
41
|
template: ProjectTemplateName, project_folder: Path
|
|
217
42
|
) -> None:
|
|
218
43
|
"""Copy a previously downloaded cache for `template` into `project_folder`.
|
|
@@ -222,7 +47,7 @@ def copy_cache_for_template_if_available(
|
|
|
222
47
|
try:
|
|
223
48
|
cache_dir = _template_cache_dir(template)
|
|
224
49
|
if cache_dir.exists() and any(cache_dir.iterdir()):
|
|
225
|
-
_copytree(cache_dir, project_folder)
|
|
50
|
+
await _copytree(cache_dir, project_folder)
|
|
226
51
|
structlogger.info(
|
|
227
52
|
"project_generator.copy_cache_for_template.success",
|
|
228
53
|
template=template,
|
|
@@ -4,6 +4,7 @@ from collections import deque
|
|
|
4
4
|
from typing import Deque, Optional, Text
|
|
5
5
|
|
|
6
6
|
import structlog
|
|
7
|
+
from pydantic import ValidationError
|
|
7
8
|
|
|
8
9
|
from rasa.core.lock import Ticket, TicketLock
|
|
9
10
|
from rasa.core.lock_store import (
|
|
@@ -12,6 +13,12 @@ from rasa.core.lock_store import (
|
|
|
12
13
|
LockError,
|
|
13
14
|
LockStore,
|
|
14
15
|
)
|
|
16
|
+
from rasa.core.redis_connection_factory import (
|
|
17
|
+
DeploymentMode,
|
|
18
|
+
RedisConfig,
|
|
19
|
+
RedisConnectionFactory,
|
|
20
|
+
)
|
|
21
|
+
from rasa.shared.exceptions import RasaException
|
|
15
22
|
from rasa.utils.endpoints import EndpointConfig
|
|
16
23
|
|
|
17
24
|
DEFAULT_REDIS_DB = 1
|
|
@@ -74,9 +81,10 @@ class ConcurrentRedisLockStore(LockStore):
|
|
|
74
81
|
alphanumeric.
|
|
75
82
|
socket_timeout - Timeout in seconds after which an exception will be raised
|
|
76
83
|
in case Redis doesn't respond within `socket_timeout` seconds.
|
|
84
|
+
deployment_mode - Redis deployment mode: standard, cluster, or sentinel.
|
|
85
|
+
endpoints - List of endpoints for cluster/sentinel mode in host:port format.
|
|
86
|
+
sentinel_service - Sentinel service name.
|
|
77
87
|
"""
|
|
78
|
-
import redis
|
|
79
|
-
|
|
80
88
|
host = endpoint_config.kwargs.get("host", DEFAULT_HOSTNAME)
|
|
81
89
|
port = endpoint_config.kwargs.get("port", DEFAULT_PORT)
|
|
82
90
|
db = endpoint_config.kwargs.get("db", DEFAULT_REDIS_DB)
|
|
@@ -90,20 +98,33 @@ class ConcurrentRedisLockStore(LockStore):
|
|
|
90
98
|
socket_timeout = endpoint_config.kwargs.get(
|
|
91
99
|
"socket_timeout", DEFAULT_SOCKET_TIMEOUT_IN_SECONDS
|
|
92
100
|
)
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
host=host,
|
|
96
|
-
port=int(port),
|
|
97
|
-
db=int(db),
|
|
98
|
-
username=username,
|
|
99
|
-
password=password,
|
|
100
|
-
ssl=use_ssl,
|
|
101
|
-
ssl_certfile=ssl_certfile,
|
|
102
|
-
ssl_keyfile=ssl_keyfile,
|
|
103
|
-
ssl_ca_certs=ssl_ca_certs,
|
|
104
|
-
socket_timeout=socket_timeout,
|
|
101
|
+
deployment_mode = endpoint_config.kwargs.get(
|
|
102
|
+
"deployment_mode", DeploymentMode.STANDARD.value
|
|
105
103
|
)
|
|
104
|
+
endpoints = endpoint_config.kwargs.get("endpoints", [])
|
|
105
|
+
sentinel_service = endpoint_config.kwargs.get("sentinel_service")
|
|
106
106
|
|
|
107
|
+
try:
|
|
108
|
+
redis_config = RedisConfig(
|
|
109
|
+
host=host,
|
|
110
|
+
port=port,
|
|
111
|
+
db=db,
|
|
112
|
+
username=username,
|
|
113
|
+
password=password,
|
|
114
|
+
use_ssl=use_ssl,
|
|
115
|
+
ssl_certfile=ssl_certfile,
|
|
116
|
+
ssl_keyfile=ssl_keyfile,
|
|
117
|
+
ssl_ca_certs=ssl_ca_certs,
|
|
118
|
+
socket_timeout=socket_timeout,
|
|
119
|
+
deployment_mode=deployment_mode,
|
|
120
|
+
endpoints=endpoints,
|
|
121
|
+
sentinel_service=sentinel_service,
|
|
122
|
+
)
|
|
123
|
+
self.red = RedisConnectionFactory.create_connection(redis_config)
|
|
124
|
+
except ValidationError as e:
|
|
125
|
+
raise RasaException(f"Invalid Redis configuration: {e}")
|
|
126
|
+
|
|
127
|
+
self.deployment_mode = deployment_mode
|
|
107
128
|
self.key_prefix = DEFAULT_CONCURRENT_REDIS_LOCK_STORE_KEY_PREFIX
|
|
108
129
|
if key_prefix:
|
|
109
130
|
structlogger.debug(
|
|
@@ -129,6 +150,32 @@ class ConcurrentRedisLockStore(LockStore):
|
|
|
129
150
|
),
|
|
130
151
|
)
|
|
131
152
|
|
|
153
|
+
def _get_keys_by_pattern(self, pattern: Text) -> list:
|
|
154
|
+
"""Get keys by pattern, using SCAN for cluster mode and KEYS for others."""
|
|
155
|
+
if self.deployment_mode == DeploymentMode.CLUSTER.value:
|
|
156
|
+
# In cluster mode, use SCAN to get keys more reliably
|
|
157
|
+
keys = []
|
|
158
|
+
cursor = 0
|
|
159
|
+
|
|
160
|
+
while True:
|
|
161
|
+
try:
|
|
162
|
+
cursor, batch_keys = self.red.scan(cursor, match=pattern, count=100)
|
|
163
|
+
keys.extend(batch_keys)
|
|
164
|
+
if cursor == 0:
|
|
165
|
+
break
|
|
166
|
+
except Exception as e:
|
|
167
|
+
structlogger.warning(
|
|
168
|
+
"concurrent_redis_lock_store._get_keys_by_pattern.scan_interrupted",
|
|
169
|
+
event_info=f"SCAN interrupted in cluster mode: {e}. "
|
|
170
|
+
f"Returning {len(keys)} keys found so far.",
|
|
171
|
+
)
|
|
172
|
+
break
|
|
173
|
+
else:
|
|
174
|
+
# Standard and sentinel modes use KEYS
|
|
175
|
+
keys = self.red.keys(pattern)
|
|
176
|
+
|
|
177
|
+
return keys
|
|
178
|
+
|
|
132
179
|
def issue_ticket(
|
|
133
180
|
self, conversation_id: Text, lock_lifetime: float = LOCK_LIFETIME
|
|
134
181
|
) -> int:
|
|
@@ -157,11 +204,14 @@ class ConcurrentRedisLockStore(LockStore):
|
|
|
157
204
|
tickets: Deque[Ticket] = deque()
|
|
158
205
|
|
|
159
206
|
pattern = self.key_prefix + conversation_id + ":" + "[0-9]*"
|
|
160
|
-
redis_keys = self.
|
|
207
|
+
redis_keys = self._get_keys_by_pattern(pattern)
|
|
161
208
|
|
|
162
209
|
for key in redis_keys:
|
|
163
210
|
serialised_ticket = self.red.get(key)
|
|
164
211
|
if serialised_ticket:
|
|
212
|
+
# Handle bytes to string conversion for JSON parsing
|
|
213
|
+
if isinstance(serialised_ticket, bytes):
|
|
214
|
+
serialised_ticket = serialised_ticket.decode("utf-8")
|
|
165
215
|
ticket = Ticket.from_dict(json.loads(serialised_ticket))
|
|
166
216
|
tickets.appendleft(ticket)
|
|
167
217
|
|
|
@@ -172,7 +222,7 @@ class ConcurrentRedisLockStore(LockStore):
|
|
|
172
222
|
def delete_lock(self, conversation_id: Text) -> None:
|
|
173
223
|
"""Deletes lock for conversation ID."""
|
|
174
224
|
pattern = self.key_prefix + conversation_id + ":*"
|
|
175
|
-
redis_keys = self.
|
|
225
|
+
redis_keys = self._get_keys_by_pattern(pattern)
|
|
176
226
|
|
|
177
227
|
if not redis_keys:
|
|
178
228
|
structlogger.debug(
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import shlex
|
|
3
3
|
import subprocess
|
|
4
|
+
import time
|
|
4
5
|
import uuid
|
|
5
6
|
from dataclasses import dataclass
|
|
6
7
|
from typing import List
|
|
@@ -149,19 +150,29 @@ def warmup() -> None:
|
|
|
149
150
|
We import them now, so that the training / deployment can later
|
|
150
151
|
directly start.
|
|
151
152
|
"""
|
|
153
|
+
start_time = time.time()
|
|
152
154
|
try:
|
|
153
155
|
import langchain # noqa: F401
|
|
154
156
|
import litellm # noqa: F401
|
|
155
157
|
import matplotlib # noqa: F401
|
|
156
158
|
import numpy # noqa: F401
|
|
157
159
|
import pandas # noqa: F401
|
|
158
|
-
import presidio_analyzer # noqa: F401
|
|
159
160
|
import spacy # noqa: F401
|
|
160
161
|
import tensorflow # noqa: F401
|
|
161
162
|
|
|
162
163
|
import rasa.validator # noqa: F401
|
|
163
|
-
except ImportError:
|
|
164
|
+
except ImportError as e:
|
|
165
|
+
structlogger.warning(
|
|
166
|
+
"model_trainer.warmup_error",
|
|
167
|
+
error=str(e),
|
|
168
|
+
)
|
|
164
169
|
pass
|
|
170
|
+
finally:
|
|
171
|
+
end_time = time.time()
|
|
172
|
+
structlogger.debug(
|
|
173
|
+
"model_trainer.warmup_time",
|
|
174
|
+
time_in_seconds=end_time - start_time,
|
|
175
|
+
)
|
|
165
176
|
|
|
166
177
|
|
|
167
178
|
def warm_rasa_main() -> None:
|
rasa/version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: rasa-pro
|
|
3
|
-
Version: 3.14.
|
|
3
|
+
Version: 3.14.0a19
|
|
4
4
|
Summary: State-of-the-art open-core Conversational AI framework for Enterprises that natively leverages generative AI for effortless assistant development.
|
|
5
5
|
Keywords: nlp,machine-learning,machine-learning-library,bot,bots,botkit,rasa conversational-agents,conversational-ai,chatbot,chatbot-framework,bot-framework
|
|
6
6
|
Author: Rasa Technologies GmbH
|
|
@@ -28,6 +28,7 @@ Requires-Dist: absl-py (>=2.0,<2.1)
|
|
|
28
28
|
Requires-Dist: aio-pika (>=8.2.3,<9.4.4)
|
|
29
29
|
Requires-Dist: aiogram (>=3.22.0,<3.23.0)
|
|
30
30
|
Requires-Dist: aiohttp (>=3.10,<3.11)
|
|
31
|
+
Requires-Dist: aioshutil (>=1.5,<2.0)
|
|
31
32
|
Requires-Dist: apscheduler (>=3.10,<3.11)
|
|
32
33
|
Requires-Dist: attrs (>=23.1,<23.2)
|
|
33
34
|
Requires-Dist: aws-msk-iam-sasl-signer-python (>=1.0.2,<1.1.0)
|
|
@@ -38,15 +38,15 @@ rasa/builder/job_manager.py,sha256=eQ5HRff-U4Cj3joHKqpjDcfCMWj4nz4D_oQmoozpwPM,2
|
|
|
38
38
|
rasa/builder/jobs.py,sha256=a3qdVsP61F1WFepIAE5U1FgA5BtqM_Tx_Qv33abkfRM,9761
|
|
39
39
|
rasa/builder/llm_service.py,sha256=y3CPQS0qHGFhe6Z4lbs2HkEVztYYVZtnWiTNjghlBdE,8859
|
|
40
40
|
rasa/builder/logging_utils.py,sha256=E1YZs5BdHT9TrnoA2758sFMD1Xw7e5mnAtqWSAZs1gk,9296
|
|
41
|
-
rasa/builder/main.py,sha256=
|
|
41
|
+
rasa/builder/main.py,sha256=hSDkcaV_gCYss9rfXjqM1QeBjEIhmRrACycoFDHKHEE,7597
|
|
42
42
|
rasa/builder/models.py,sha256=Las1o3skn8n20A8njiH6xMpcEL6uORK-uIpYm0fsF1Q,6014
|
|
43
|
-
rasa/builder/project_generator.py,sha256=
|
|
43
|
+
rasa/builder/project_generator.py,sha256=MZeAx-9xrpP-ILrm6veWazcrCEmWarhBb54eyF2HEqQ,18227
|
|
44
44
|
rasa/builder/project_info.py,sha256=ZBwFCigZLSo1RBMhlZDYBoVl2G-9OnhRrYxdMWHn6S4,2093
|
|
45
45
|
rasa/builder/scrape_rasa_docs.py,sha256=iR_uThYA_kjDeIFY7AdpXcP-30P2vOHQ65gH4S1OjLw,2485
|
|
46
46
|
rasa/builder/service.py,sha256=4XtAO1OS1Re_fDmy9ztA4XdR7vJg1FFK-1CLrTY2jKQ,47721
|
|
47
47
|
rasa/builder/shared/tracker_context.py,sha256=2P-DsWjWEkZ32dqrx6s4zVxdo0_mokZNrU3LYisu6MY,7691
|
|
48
48
|
rasa/builder/skill_to_bot_prompt.jinja2,sha256=h2Fgoh9k3XinN0blEEqMuOWuvwXxJifP3GJs-GczgBU,5530
|
|
49
|
-
rasa/builder/template_cache.py,sha256=
|
|
49
|
+
rasa/builder/template_cache.py,sha256=0ms5P4zvAtio9AhwKbazUwaYZQZxa8DToC3ieLi-UZ8,2350
|
|
50
50
|
rasa/builder/training_service.py,sha256=kmcxgCxZzklxr4RKqan3aA_BU3pRE7WS_q-AO5sFyxM,5975
|
|
51
51
|
rasa/builder/validation_service.py,sha256=FAHSf2tQZ8yDlckWWjqMqhjb0rANbXR2DJTybh4fHnM,3099
|
|
52
52
|
rasa/cli/__init__.py,sha256=eO5vp9rFCANtbTVU-pxN3iMBKw4p9WRcgzytt9MzinY,115
|
|
@@ -507,7 +507,7 @@ rasa/core/channels/voice_stream/twilio_media_streams.py,sha256=Xe2coQT0b1v7eC0FR
|
|
|
507
507
|
rasa/core/channels/voice_stream/util.py,sha256=nbr0yUl0NIn4-94VUYjPEg_NB2kadcFCq-i9rRJMv4U,2323
|
|
508
508
|
rasa/core/channels/voice_stream/voice_channel.py,sha256=f9C_jm_VA7NOBg0KidpMeyAWilXQ0jVNwct11Y77qRc,26287
|
|
509
509
|
rasa/core/channels/webexteams.py,sha256=z_o_jnc6B7hsHpd6XorImFkF43wB4yx_kiTPKAjPSuo,4805
|
|
510
|
-
rasa/core/concurrent_lock_store.py,sha256=
|
|
510
|
+
rasa/core/concurrent_lock_store.py,sha256=XAIrKuhN7hHVWMyNF8znzmWW6WsL249AQjm3V_5HFx4,10663
|
|
511
511
|
rasa/core/constants.py,sha256=Xb5BtXu3Z7N8IYL2xS52UM_lcS3i0yC-0Wlnyi3Gnwk,4300
|
|
512
512
|
rasa/core/evaluation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
513
513
|
rasa/core/evaluation/marker.py,sha256=qjCsjif5d8TYy74g__NL8YyEFL8MYOaI-PgfZ2jOyiY,9155
|
|
@@ -795,7 +795,7 @@ rasa/model_manager/socket_bridge.py,sha256=p0xJXqcIAekMztVv88umUYs5nkUTTan-4nUyV
|
|
|
795
795
|
rasa/model_manager/studio_jwt_auth.py,sha256=uls2QiHUlUrR3fOzZssW4UaAMJMfnPMZeV1aDmZIT0E,2645
|
|
796
796
|
rasa/model_manager/trainer_service.py,sha256=-PgNgLDkzyPynUN73C8qGQaMfHJV1JNmm5gepyVnXak,10779
|
|
797
797
|
rasa/model_manager/utils.py,sha256=0tYmzBcta_9h4cpbHtrH1hUqd-qzjl0xmveStTBPmGo,1695
|
|
798
|
-
rasa/model_manager/warm_rasa_process.py,sha256=
|
|
798
|
+
rasa/model_manager/warm_rasa_process.py,sha256=LmNLV-udIqUJYxQc5tA4xEJqJ8SPPGDtUBDEP0525WY,6124
|
|
799
799
|
rasa/model_service.py,sha256=XXCaiLj2xq58n05W3R1jmTIv-V8f_7PG30kVpRxf71Y,3727
|
|
800
800
|
rasa/model_testing.py,sha256=eZw7l8Zz3HkH_ZPBurY93HzzudHdoQn8HBnDdZSysAY,14929
|
|
801
801
|
rasa/model_training.py,sha256=10cw_CIN3q05gmTHqUdLgsfSlmyWPL0dSkrkflYbOmA,22071
|
|
@@ -1074,9 +1074,9 @@ rasa/utils/train_utils.py,sha256=ClJx-6x3-h3Vt6mskacgkcCUJTMXjFPe3zAcy_DfmaU,212
|
|
|
1074
1074
|
rasa/utils/url_tools.py,sha256=dZ1HGkVdWTJB7zYEdwoDIrEuyX9HE5WsxKKFVsXBLE0,1218
|
|
1075
1075
|
rasa/utils/yaml.py,sha256=KjbZq5C94ZP7Jdsw8bYYF7HASI6K4-C_kdHfrnPLpSI,2000
|
|
1076
1076
|
rasa/validator.py,sha256=_5IjhhzG-_LM5_Bpa09siEQATgFRYEsPp9FbOwXzVmM,83275
|
|
1077
|
-
rasa/version.py,sha256=
|
|
1078
|
-
rasa_pro-3.14.
|
|
1079
|
-
rasa_pro-3.14.
|
|
1080
|
-
rasa_pro-3.14.
|
|
1081
|
-
rasa_pro-3.14.
|
|
1082
|
-
rasa_pro-3.14.
|
|
1077
|
+
rasa/version.py,sha256=1LNjJOE7ktRelqsQVZW9cxEG4u7XcCRmZsvB_XNQUi8,120
|
|
1078
|
+
rasa_pro-3.14.0a19.dist-info/METADATA,sha256=hCTv8VJR1MPaZpuB5KXIMpnPFi_RORBuAt765Q8uE7g,10274
|
|
1079
|
+
rasa_pro-3.14.0a19.dist-info/NOTICE,sha256=7HlBoMHJY9CL2GlYSfTQ-PZsVmLmVkYmMiPlTjhuCqA,218
|
|
1080
|
+
rasa_pro-3.14.0a19.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
|
1081
|
+
rasa_pro-3.14.0a19.dist-info/entry_points.txt,sha256=ckJ2SfEyTPgBqj_I6vm_tqY9dZF_LAPJZA335Xp0Q9U,43
|
|
1082
|
+
rasa_pro-3.14.0a19.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|