rasa-pro 3.14.1__py3-none-any.whl → 3.15.0a3__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/config.py +4 -0
- rasa/builder/constants.py +5 -0
- rasa/builder/copilot/copilot.py +28 -9
- rasa/builder/copilot/models.py +251 -32
- rasa/builder/document_retrieval/inkeep_document_retrieval.py +2 -0
- rasa/builder/download.py +111 -1
- rasa/builder/evaluator/__init__.py +0 -0
- rasa/builder/evaluator/constants.py +15 -0
- rasa/builder/evaluator/copilot_executor.py +89 -0
- rasa/builder/evaluator/dataset/models.py +173 -0
- rasa/builder/evaluator/exceptions.py +4 -0
- rasa/builder/evaluator/response_classification/__init__.py +0 -0
- rasa/builder/evaluator/response_classification/constants.py +66 -0
- rasa/builder/evaluator/response_classification/evaluator.py +346 -0
- rasa/builder/evaluator/response_classification/langfuse_runner.py +463 -0
- rasa/builder/evaluator/response_classification/models.py +61 -0
- rasa/builder/evaluator/scripts/__init__.py +0 -0
- rasa/builder/evaluator/scripts/run_response_classification_evaluator.py +152 -0
- rasa/builder/jobs.py +208 -1
- rasa/builder/logging_utils.py +25 -24
- rasa/builder/main.py +6 -1
- rasa/builder/models.py +23 -0
- rasa/builder/project_generator.py +29 -10
- rasa/builder/service.py +205 -46
- rasa/builder/telemetry/__init__.py +0 -0
- rasa/builder/telemetry/copilot_langfuse_telemetry.py +384 -0
- rasa/builder/{copilot/telemetry.py → telemetry/copilot_segment_telemetry.py} +21 -3
- rasa/builder/training_service.py +13 -1
- rasa/builder/validation_service.py +2 -1
- rasa/constants.py +1 -0
- rasa/core/actions/action_clean_stack.py +32 -0
- rasa/core/actions/constants.py +4 -0
- rasa/core/actions/custom_action_executor.py +70 -12
- rasa/core/actions/grpc_custom_action_executor.py +41 -2
- rasa/core/actions/http_custom_action_executor.py +49 -25
- rasa/core/channels/voice_stream/voice_channel.py +14 -2
- rasa/core/policies/flows/flow_executor.py +20 -6
- rasa/core/run.py +15 -4
- rasa/dialogue_understanding/generator/llm_based_command_generator.py +6 -3
- rasa/dialogue_understanding/generator/single_step/compact_llm_command_generator.py +15 -7
- rasa/dialogue_understanding/generator/single_step/search_ready_llm_command_generator.py +15 -8
- rasa/dialogue_understanding/processor/command_processor.py +49 -7
- rasa/e2e_test/e2e_config.py +4 -3
- rasa/engine/recipes/default_components.py +16 -6
- rasa/graph_components/validators/default_recipe_validator.py +10 -4
- rasa/nlu/classifiers/diet_classifier.py +2 -0
- rasa/shared/core/slots.py +55 -24
- rasa/shared/providers/_configs/azure_openai_client_config.py +4 -5
- rasa/shared/providers/_configs/default_litellm_client_config.py +4 -4
- rasa/shared/providers/_configs/litellm_router_client_config.py +3 -2
- rasa/shared/providers/_configs/openai_client_config.py +5 -7
- rasa/shared/providers/_configs/rasa_llm_client_config.py +4 -4
- rasa/shared/providers/_configs/self_hosted_llm_client_config.py +4 -4
- rasa/shared/providers/llm/_base_litellm_client.py +42 -14
- rasa/shared/providers/llm/litellm_router_llm_client.py +38 -15
- rasa/shared/providers/llm/self_hosted_llm_client.py +34 -32
- rasa/shared/utils/common.py +9 -1
- rasa/shared/utils/configs.py +5 -8
- rasa/utils/common.py +9 -0
- rasa/utils/endpoints.py +8 -0
- rasa/utils/installation_utils.py +111 -0
- rasa/utils/tensorflow/callback.py +2 -0
- rasa/utils/train_utils.py +2 -0
- rasa/version.py +1 -1
- {rasa_pro-3.14.1.dist-info → rasa_pro-3.15.0a3.dist-info}/METADATA +15 -13
- {rasa_pro-3.14.1.dist-info → rasa_pro-3.15.0a3.dist-info}/RECORD +69 -53
- {rasa_pro-3.14.1.dist-info → rasa_pro-3.15.0a3.dist-info}/NOTICE +0 -0
- {rasa_pro-3.14.1.dist-info → rasa_pro-3.15.0a3.dist-info}/WHEEL +0 -0
- {rasa_pro-3.14.1.dist-info → rasa_pro-3.15.0a3.dist-info}/entry_points.txt +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
import asyncio
|
|
3
4
|
import logging
|
|
4
5
|
import os
|
|
5
6
|
from typing import Any, Dict, List, Optional, Union
|
|
@@ -7,6 +8,7 @@ from typing import Any, Dict, List, Optional, Union
|
|
|
7
8
|
import structlog
|
|
8
9
|
from litellm import atext_completion, text_completion
|
|
9
10
|
|
|
11
|
+
from rasa.core.constants import DEFAULT_REQUEST_TIMEOUT
|
|
10
12
|
from rasa.shared.constants import (
|
|
11
13
|
API_KEY,
|
|
12
14
|
SELF_HOSTED_VLLM_API_KEY_ENV_VAR,
|
|
@@ -28,7 +30,7 @@ structlogger = structlog.get_logger()
|
|
|
28
30
|
|
|
29
31
|
|
|
30
32
|
class SelfHostedLLMClient(_BaseLiteLLMClient):
|
|
31
|
-
"""A client for interfacing with Self Hosted LLM endpoints
|
|
33
|
+
"""A client for interfacing with Self Hosted LLM endpoints.
|
|
32
34
|
|
|
33
35
|
Parameters:
|
|
34
36
|
model (str): The model or deployment name.
|
|
@@ -95,8 +97,7 @@ class SelfHostedLLMClient(_BaseLiteLLMClient):
|
|
|
95
97
|
|
|
96
98
|
@property
|
|
97
99
|
def provider(self) -> str:
|
|
98
|
-
"""
|
|
99
|
-
Returns the provider name for the self hosted llm client.
|
|
100
|
+
"""Returns the provider name for the self hosted llm client.
|
|
100
101
|
|
|
101
102
|
Returns:
|
|
102
103
|
String representing the provider name.
|
|
@@ -105,8 +106,7 @@ class SelfHostedLLMClient(_BaseLiteLLMClient):
|
|
|
105
106
|
|
|
106
107
|
@property
|
|
107
108
|
def model(self) -> str:
|
|
108
|
-
"""
|
|
109
|
-
Returns the model name for the self hosted llm client.
|
|
109
|
+
"""Returns the model name for the self hosted llm client.
|
|
110
110
|
|
|
111
111
|
Returns:
|
|
112
112
|
String representing the model name.
|
|
@@ -115,8 +115,7 @@ class SelfHostedLLMClient(_BaseLiteLLMClient):
|
|
|
115
115
|
|
|
116
116
|
@property
|
|
117
117
|
def api_base(self) -> str:
|
|
118
|
-
"""
|
|
119
|
-
Returns the base URL for the API endpoint.
|
|
118
|
+
"""Returns the base URL for the API endpoint.
|
|
120
119
|
|
|
121
120
|
Returns:
|
|
122
121
|
String representing the base URL.
|
|
@@ -125,8 +124,7 @@ class SelfHostedLLMClient(_BaseLiteLLMClient):
|
|
|
125
124
|
|
|
126
125
|
@property
|
|
127
126
|
def api_type(self) -> Optional[str]:
|
|
128
|
-
"""
|
|
129
|
-
Returns the type of the API endpoint. Currently only OpenAI is supported.
|
|
127
|
+
"""Returns the type of the API endpoint. Currently only OpenAI is supported.
|
|
130
128
|
|
|
131
129
|
Returns:
|
|
132
130
|
String representing the API type.
|
|
@@ -135,8 +133,7 @@ class SelfHostedLLMClient(_BaseLiteLLMClient):
|
|
|
135
133
|
|
|
136
134
|
@property
|
|
137
135
|
def api_version(self) -> Optional[str]:
|
|
138
|
-
"""
|
|
139
|
-
Returns the version of the API endpoint.
|
|
136
|
+
"""Returns the version of the API endpoint.
|
|
140
137
|
|
|
141
138
|
Returns:
|
|
142
139
|
String representing the API version.
|
|
@@ -145,8 +142,8 @@ class SelfHostedLLMClient(_BaseLiteLLMClient):
|
|
|
145
142
|
|
|
146
143
|
@property
|
|
147
144
|
def config(self) -> Dict:
|
|
148
|
-
"""
|
|
149
|
-
|
|
145
|
+
"""Returns the configuration for the self hosted llm client.
|
|
146
|
+
|
|
150
147
|
Returns:
|
|
151
148
|
Dictionary containing the configuration.
|
|
152
149
|
"""
|
|
@@ -163,9 +160,9 @@ class SelfHostedLLMClient(_BaseLiteLLMClient):
|
|
|
163
160
|
|
|
164
161
|
@property
|
|
165
162
|
def _litellm_model_name(self) -> str:
|
|
166
|
-
"""Returns the value of LiteLLM's model parameter
|
|
167
|
-
completion/acompletion in LiteLLM format:
|
|
163
|
+
"""Returns the value of LiteLLM's model parameter.
|
|
168
164
|
|
|
165
|
+
To be used in completion/acompletion in LiteLLM format:
|
|
169
166
|
<hosted_vllm>/<model or deployment name>
|
|
170
167
|
"""
|
|
171
168
|
if self.model and f"{SELF_HOSTED_VLLM_PREFIX}/" not in self.model:
|
|
@@ -174,15 +171,17 @@ class SelfHostedLLMClient(_BaseLiteLLMClient):
|
|
|
174
171
|
|
|
175
172
|
@property
|
|
176
173
|
def _litellm_extra_parameters(self) -> Dict[str, Any]:
|
|
177
|
-
"""Returns optional configuration parameters
|
|
178
|
-
|
|
174
|
+
"""Returns optional configuration parameters.
|
|
175
|
+
|
|
176
|
+
Specific to the client provider and deployed model.
|
|
179
177
|
"""
|
|
180
178
|
return self._extra_parameters
|
|
181
179
|
|
|
182
180
|
@property
|
|
183
181
|
def _completion_fn_args(self) -> Dict[str, Any]:
|
|
184
|
-
"""Returns the completion arguments
|
|
185
|
-
|
|
182
|
+
"""Returns the completion arguments.
|
|
183
|
+
|
|
184
|
+
For invoking a call through LiteLLM's completion functions.
|
|
186
185
|
"""
|
|
187
186
|
fn_args = super()._completion_fn_args
|
|
188
187
|
fn_args.update(
|
|
@@ -195,13 +194,14 @@ class SelfHostedLLMClient(_BaseLiteLLMClient):
|
|
|
195
194
|
|
|
196
195
|
@suppress_logs(log_level=logging.WARNING)
|
|
197
196
|
def _text_completion(self, prompt: Union[List[str], str]) -> LLMResponse:
|
|
198
|
-
"""
|
|
199
|
-
Synchronously generate completions for given prompt.
|
|
197
|
+
"""Synchronously generate completions for given prompt.
|
|
200
198
|
|
|
201
199
|
Args:
|
|
202
200
|
prompt: Prompt to generate the completion for.
|
|
201
|
+
|
|
203
202
|
Returns:
|
|
204
203
|
List of message completions.
|
|
204
|
+
|
|
205
205
|
Raises:
|
|
206
206
|
ProviderClientAPIException: If the API request fails.
|
|
207
207
|
"""
|
|
@@ -213,26 +213,28 @@ class SelfHostedLLMClient(_BaseLiteLLMClient):
|
|
|
213
213
|
|
|
214
214
|
@suppress_logs(log_level=logging.WARNING)
|
|
215
215
|
async def _atext_completion(self, prompt: Union[List[str], str]) -> LLMResponse:
|
|
216
|
-
"""
|
|
217
|
-
Asynchronously generate completions for given prompt.
|
|
216
|
+
"""Asynchronously generate completions for given prompt.
|
|
218
217
|
|
|
219
218
|
Args:
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
with the following keys:
|
|
223
|
-
- content: The message content.
|
|
224
|
-
- role: The role of the message (e.g. user or system).
|
|
225
|
-
- a list of messages. Each message is a string and will be formatted
|
|
226
|
-
as a user message.
|
|
227
|
-
- a single message as a string which will be formatted as user message.
|
|
219
|
+
prompt: Prompt to generate the completion for.
|
|
220
|
+
|
|
228
221
|
Returns:
|
|
229
222
|
List of message completions.
|
|
223
|
+
|
|
230
224
|
Raises:
|
|
231
225
|
ProviderClientAPIException: If the API request fails.
|
|
232
226
|
"""
|
|
233
227
|
try:
|
|
234
|
-
|
|
228
|
+
timeout = self._litellm_extra_parameters.get(
|
|
229
|
+
"timeout", DEFAULT_REQUEST_TIMEOUT
|
|
230
|
+
)
|
|
231
|
+
response = await asyncio.wait_for(
|
|
232
|
+
atext_completion(prompt=prompt, **self._completion_fn_args),
|
|
233
|
+
timeout=timeout,
|
|
234
|
+
)
|
|
235
235
|
return self._format_text_completion_response(response)
|
|
236
|
+
except asyncio.TimeoutError:
|
|
237
|
+
self._handle_timeout_error()
|
|
236
238
|
except Exception as e:
|
|
237
239
|
raise ProviderClientAPIException(e)
|
|
238
240
|
|
rasa/shared/utils/common.py
CHANGED
|
@@ -26,6 +26,7 @@ from rasa.exceptions import MissingDependencyException
|
|
|
26
26
|
from rasa.shared.constants import DOCS_URL_MIGRATION_GUIDE
|
|
27
27
|
from rasa.shared.exceptions import ProviderClientValidationError, RasaException
|
|
28
28
|
from rasa.shared.utils.cli import print_success
|
|
29
|
+
from rasa.utils.installation_utils import check_for_installation_issues
|
|
29
30
|
|
|
30
31
|
logger = logging.getLogger(__name__)
|
|
31
32
|
|
|
@@ -396,7 +397,11 @@ Sign up at: https://feedback.rasa.com
|
|
|
396
397
|
print_success(message)
|
|
397
398
|
|
|
398
399
|
|
|
399
|
-
def conditional_import(
|
|
400
|
+
def conditional_import(
|
|
401
|
+
module_name: str,
|
|
402
|
+
class_name: str,
|
|
403
|
+
check_installation_setup: bool = False,
|
|
404
|
+
) -> Tuple[Any, bool]:
|
|
400
405
|
"""Conditionally import a class, returning (class, is_available) tuple.
|
|
401
406
|
|
|
402
407
|
Args:
|
|
@@ -408,6 +413,9 @@ def conditional_import(module_name: str, class_name: str) -> Tuple[Any, bool]:
|
|
|
408
413
|
or None if import failed, and is_available is a boolean indicating
|
|
409
414
|
whether the import was successful.
|
|
410
415
|
"""
|
|
416
|
+
if check_installation_setup:
|
|
417
|
+
check_for_installation_issues()
|
|
418
|
+
|
|
411
419
|
try:
|
|
412
420
|
module = __import__(module_name, fromlist=[class_name])
|
|
413
421
|
return getattr(module, class_name), True
|
rasa/shared/utils/configs.py
CHANGED
|
@@ -8,8 +8,7 @@ structlogger = structlog.get_logger()
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
def resolve_aliases(config: dict, deprecated_alias_mapping: dict) -> dict:
|
|
11
|
-
"""
|
|
12
|
-
Resolve aliases in the configuration to standard keys.
|
|
11
|
+
"""Resolve aliases in the configuration to standard keys.
|
|
13
12
|
|
|
14
13
|
Args:
|
|
15
14
|
config: Dictionary containing the configuration.
|
|
@@ -37,13 +36,13 @@ def raise_deprecation_warnings(
|
|
|
37
36
|
deprecated_alias_mapping: dict,
|
|
38
37
|
source: Optional[str] = None,
|
|
39
38
|
) -> None:
|
|
40
|
-
"""
|
|
41
|
-
Raises warnings for deprecated keys in the configuration.
|
|
39
|
+
"""Raises warnings for deprecated keys in the configuration.
|
|
42
40
|
|
|
43
41
|
Args:
|
|
44
42
|
config: Dictionary containing the configuration.
|
|
45
43
|
deprecated_alias_mapping: Dictionary mapping deprecated keys to
|
|
46
44
|
their standard keys.
|
|
45
|
+
source: Optional source context for the deprecation warning.
|
|
47
46
|
|
|
48
47
|
Raises:
|
|
49
48
|
DeprecationWarning: If any deprecated key is found in the config.
|
|
@@ -61,8 +60,7 @@ def raise_deprecation_warnings(
|
|
|
61
60
|
|
|
62
61
|
|
|
63
62
|
def validate_required_keys(config: dict, required_keys: list) -> None:
|
|
64
|
-
"""
|
|
65
|
-
Validates that the passed config contains all the required keys.
|
|
63
|
+
"""Validates that the passed config contains all the required keys.
|
|
66
64
|
|
|
67
65
|
Args:
|
|
68
66
|
config: Dictionary containing the configuration.
|
|
@@ -84,8 +82,7 @@ def validate_required_keys(config: dict, required_keys: list) -> None:
|
|
|
84
82
|
|
|
85
83
|
|
|
86
84
|
def validate_forbidden_keys(config: dict, forbidden_keys: list) -> None:
|
|
87
|
-
"""
|
|
88
|
-
Validates that the passed config doesn't contain any forbidden keys.
|
|
85
|
+
"""Validates that the passed config doesn't contain any forbidden keys.
|
|
89
86
|
|
|
90
87
|
Args:
|
|
91
88
|
config: Dictionary containing the configuration.
|
rasa/utils/common.py
CHANGED
|
@@ -36,6 +36,7 @@ from rasa.constants import (
|
|
|
36
36
|
ENV_LOG_LEVEL_LIBRARIES,
|
|
37
37
|
ENV_LOG_LEVEL_MATPLOTLIB,
|
|
38
38
|
ENV_LOG_LEVEL_MCP,
|
|
39
|
+
ENV_LOG_LEVEL_PYMONGO,
|
|
39
40
|
ENV_LOG_LEVEL_RABBITMQ,
|
|
40
41
|
ENV_MCP_LOGGING_ENABLED,
|
|
41
42
|
)
|
|
@@ -297,6 +298,7 @@ def configure_library_logging() -> None:
|
|
|
297
298
|
update_rabbitmq_log_level(library_log_level)
|
|
298
299
|
update_websockets_log_level(library_log_level)
|
|
299
300
|
update_mcp_log_level()
|
|
301
|
+
update_pymongo_log_level(library_log_level)
|
|
300
302
|
|
|
301
303
|
|
|
302
304
|
def update_apscheduler_log_level() -> None:
|
|
@@ -481,6 +483,13 @@ def update_mcp_log_level() -> None:
|
|
|
481
483
|
logging.getLogger(logger_name).propagate = False
|
|
482
484
|
|
|
483
485
|
|
|
486
|
+
def update_pymongo_log_level(library_log_level: str) -> None:
|
|
487
|
+
"""Set the log level of pymongo."""
|
|
488
|
+
log_level = os.environ.get(ENV_LOG_LEVEL_PYMONGO, library_log_level)
|
|
489
|
+
logging.getLogger("pymongo").setLevel(log_level)
|
|
490
|
+
logging.getLogger("pymongo").propagate = False
|
|
491
|
+
|
|
492
|
+
|
|
484
493
|
def sort_list_of_dicts_by_first_key(dicts: List[Dict]) -> List[Dict]:
|
|
485
494
|
"""Sorts a list of dictionaries by their first key."""
|
|
486
495
|
return sorted(dicts, key=lambda d: next(iter(d.keys())))
|
rasa/utils/endpoints.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import ssl
|
|
3
|
+
from functools import lru_cache
|
|
3
4
|
from pathlib import Path
|
|
4
5
|
from types import ModuleType
|
|
5
6
|
from typing import Any, Dict, List, Optional, Text, Union
|
|
@@ -9,6 +10,7 @@ import structlog
|
|
|
9
10
|
from aiohttp.client_exceptions import ContentTypeError
|
|
10
11
|
from sanic.request import Request
|
|
11
12
|
|
|
13
|
+
from rasa.core.actions.constants import MISSING_DOMAIN_MARKER
|
|
12
14
|
from rasa.core.constants import DEFAULT_REQUEST_TIMEOUT
|
|
13
15
|
from rasa.shared.exceptions import FileNotFoundException
|
|
14
16
|
from rasa.shared.utils.yaml import read_config_file
|
|
@@ -16,6 +18,7 @@ from rasa.shared.utils.yaml import read_config_file
|
|
|
16
18
|
structlogger = structlog.get_logger()
|
|
17
19
|
|
|
18
20
|
|
|
21
|
+
@lru_cache(maxsize=10)
|
|
19
22
|
def read_endpoint_config(
|
|
20
23
|
filename: Union[str, Path], endpoint_type: Text
|
|
21
24
|
) -> Optional["EndpointConfig"]:
|
|
@@ -222,6 +225,11 @@ class EndpointConfig:
|
|
|
222
225
|
ssl=sslcontext,
|
|
223
226
|
**kwargs,
|
|
224
227
|
) as response:
|
|
228
|
+
if response.status == 449:
|
|
229
|
+
# Return a special marker that HTTPCustomActionExecutor can detect
|
|
230
|
+
# This avoids raising an exception for this expected case
|
|
231
|
+
return {MISSING_DOMAIN_MARKER: True}
|
|
232
|
+
|
|
225
233
|
if response.status >= 400:
|
|
226
234
|
raise ClientResponseError(
|
|
227
235
|
response.status,
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import importlib.util
|
|
2
|
+
import sys
|
|
3
|
+
|
|
4
|
+
import structlog
|
|
5
|
+
|
|
6
|
+
structlogger = structlog.get_logger()
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def check_tensorflow_installation() -> None:
|
|
10
|
+
"""Check if TensorFlow is installed without proper Rasa extras."""
|
|
11
|
+
# Check if tensorflow is available in the environment
|
|
12
|
+
tensorflow_available = importlib.util.find_spec("tensorflow") is not None
|
|
13
|
+
|
|
14
|
+
if not tensorflow_available:
|
|
15
|
+
return
|
|
16
|
+
|
|
17
|
+
# Check if any TensorFlow-related extras were installed
|
|
18
|
+
# We do this by checking for packages that are only installed with nlu/full extras
|
|
19
|
+
tensorflow_extras_indicators = [
|
|
20
|
+
"tensorflow_text", # Only in nlu/full extras
|
|
21
|
+
"tensorflow_hub", # Only in nlu/full extras
|
|
22
|
+
"tf_keras", # Only in nlu/full extras
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
extras_installed = any(
|
|
26
|
+
importlib.util.find_spec(pkg) is not None
|
|
27
|
+
for pkg in tensorflow_extras_indicators
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
if tensorflow_available and not extras_installed:
|
|
31
|
+
structlogger.warning(
|
|
32
|
+
"installation_utils.tensorflow_installation",
|
|
33
|
+
warning=(
|
|
34
|
+
"TensorFlow is installed but Rasa was not installed with TensorFlow "
|
|
35
|
+
"support, i.e. additional packages required to use NLU components "
|
|
36
|
+
"have not been installed. For the most reliable setup, delete your "
|
|
37
|
+
"current virtual environment, create a new one, and install Rasa "
|
|
38
|
+
"again. Please follow the instructions at "
|
|
39
|
+
"https://rasa.com/docs/pro/installation/python"
|
|
40
|
+
),
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def check_tensorflow_integrity() -> None:
|
|
45
|
+
"""Check if TensorFlow installation is corrupted or incomplete."""
|
|
46
|
+
# Only check if tensorflow is available
|
|
47
|
+
if importlib.util.find_spec("tensorflow") is None:
|
|
48
|
+
return
|
|
49
|
+
|
|
50
|
+
try:
|
|
51
|
+
# Try to import tensorflow - this will fail if installation is corrupted
|
|
52
|
+
import tensorflow as tf
|
|
53
|
+
|
|
54
|
+
# Try to access a basic TensorFlow function
|
|
55
|
+
_ = tf.constant([1, 2, 3])
|
|
56
|
+
except Exception:
|
|
57
|
+
# Simplified error message for all TensorFlow corruption issues
|
|
58
|
+
structlogger.error(
|
|
59
|
+
"installation_utils.tensorflow_integrity",
|
|
60
|
+
issue=(
|
|
61
|
+
"TensorFlow is installed but appears to be corrupted or incomplete. "
|
|
62
|
+
"For the most reliable setup, delete your current virtual "
|
|
63
|
+
"environment, create a new one, and install Rasa again. "
|
|
64
|
+
"Please follow the instructions at "
|
|
65
|
+
"https://rasa.com/docs/pro/installation/python"
|
|
66
|
+
),
|
|
67
|
+
)
|
|
68
|
+
sys.exit(1)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def check_rasa_availability() -> None:
|
|
72
|
+
"""Check if Rasa is installed and importable."""
|
|
73
|
+
if importlib.util.find_spec("rasa") is None:
|
|
74
|
+
structlogger.error(
|
|
75
|
+
"installation_utils.rasa_availability",
|
|
76
|
+
issue=(
|
|
77
|
+
"Rasa is not installed in this environment. "
|
|
78
|
+
"Please follow the instructions at "
|
|
79
|
+
"https://rasa.com/docs/pro/installation/python"
|
|
80
|
+
),
|
|
81
|
+
)
|
|
82
|
+
sys.exit(1)
|
|
83
|
+
|
|
84
|
+
try:
|
|
85
|
+
_ = importlib.import_module("rasa")
|
|
86
|
+
except Exception as e:
|
|
87
|
+
structlogger.error(
|
|
88
|
+
"installation_utils.rasa_availability",
|
|
89
|
+
issue=(
|
|
90
|
+
f"Rasa is installed but cannot be imported: {e!s}."
|
|
91
|
+
f"Please follow the instructions at "
|
|
92
|
+
f"https://rasa.com/docs/pro/installation/python"
|
|
93
|
+
),
|
|
94
|
+
)
|
|
95
|
+
sys.exit(1)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def check_for_installation_issues() -> None:
|
|
99
|
+
"""Check for all potential installation issues.
|
|
100
|
+
|
|
101
|
+
Returns:
|
|
102
|
+
List of warning messages for detected issues.
|
|
103
|
+
"""
|
|
104
|
+
# Check if Rasa is available first
|
|
105
|
+
check_rasa_availability()
|
|
106
|
+
|
|
107
|
+
# Check TensorFlow integrity first (more critical)
|
|
108
|
+
check_tensorflow_integrity()
|
|
109
|
+
|
|
110
|
+
# Check for orphaned TensorFlow
|
|
111
|
+
check_tensorflow_installation()
|
|
@@ -2,9 +2,11 @@ import logging
|
|
|
2
2
|
from pathlib import Path
|
|
3
3
|
from typing import Any, Dict, Optional, Text
|
|
4
4
|
|
|
5
|
+
from rasa.utils.installation_utils import check_for_installation_issues
|
|
5
6
|
from rasa.utils.tensorflow import TENSORFLOW_AVAILABLE
|
|
6
7
|
|
|
7
8
|
if TENSORFLOW_AVAILABLE:
|
|
9
|
+
check_for_installation_issues()
|
|
8
10
|
import tensorflow as tf
|
|
9
11
|
from tqdm import tqdm
|
|
10
12
|
else:
|
rasa/utils/train_utils.py
CHANGED
|
@@ -11,10 +11,12 @@ from rasa.nlu.constants import NUMBER_OF_SUB_TOKENS
|
|
|
11
11
|
from rasa.shared.constants import NEXT_MAJOR_VERSION_FOR_DEPRECATIONS
|
|
12
12
|
from rasa.shared.exceptions import InvalidConfigException
|
|
13
13
|
from rasa.shared.nlu.constants import SPLIT_ENTITIES_BY_COMMA
|
|
14
|
+
from rasa.utils.installation_utils import check_for_installation_issues
|
|
14
15
|
from rasa.utils.tensorflow import TENSORFLOW_AVAILABLE
|
|
15
16
|
|
|
16
17
|
# Conditional imports for TensorFlow-dependent modules
|
|
17
18
|
if TENSORFLOW_AVAILABLE:
|
|
19
|
+
check_for_installation_issues()
|
|
18
20
|
from rasa.utils.tensorflow.callback import RasaModelCheckpoint, RasaTrainingLogger
|
|
19
21
|
from rasa.utils.tensorflow.constants import (
|
|
20
22
|
AUTO,
|
rasa/version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: rasa-pro
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.15.0a3
|
|
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
|
|
@@ -21,6 +21,7 @@ Provides-Extra: full
|
|
|
21
21
|
Provides-Extra: gh-release-notes
|
|
22
22
|
Provides-Extra: jieba
|
|
23
23
|
Provides-Extra: metal
|
|
24
|
+
Provides-Extra: monitoring
|
|
24
25
|
Provides-Extra: nlu
|
|
25
26
|
Provides-Extra: pii
|
|
26
27
|
Provides-Extra: spacy
|
|
@@ -38,16 +39,16 @@ Requires-Dist: apscheduler (>=3.11,<3.12)
|
|
|
38
39
|
Requires-Dist: attrs (>=23.1,<25.0)
|
|
39
40
|
Requires-Dist: audioop-lts (>=0.2.2,<0.3.0) ; python_version >= "3.13"
|
|
40
41
|
Requires-Dist: aws-msk-iam-sasl-signer-python (>=1.0.2,<1.1.0)
|
|
41
|
-
Requires-Dist: azure-identity (>=1.
|
|
42
|
-
Requires-Dist: azure-storage-blob (>=12.
|
|
43
|
-
Requires-Dist: boto3 (>=1.40.
|
|
42
|
+
Requires-Dist: azure-identity (>=1.25.1,<1.26.0)
|
|
43
|
+
Requires-Dist: azure-storage-blob (>=12.27.0,<12.28.0)
|
|
44
|
+
Requires-Dist: boto3 (>=1.40.60,<1.41.0)
|
|
44
45
|
Requires-Dist: certifi (>=2025.10.5,<2025.11.0)
|
|
45
46
|
Requires-Dist: colorama (>=0.4.6,<0.5.0) ; sys_platform == "win32"
|
|
46
47
|
Requires-Dist: colorclass (>=2.2,<2.3)
|
|
47
48
|
Requires-Dist: coloredlogs (>=15,<16)
|
|
48
49
|
Requires-Dist: colorhash (>=2.0,<2.1.0)
|
|
49
50
|
Requires-Dist: confluent-kafka (>=2.11.0,<3.0.0)
|
|
50
|
-
Requires-Dist: cryptography (>=
|
|
51
|
+
Requires-Dist: cryptography (>=46.0.3,<46.1.0)
|
|
51
52
|
Requires-Dist: cvg-python-sdk (>=0.5.1,<0.6.0) ; extra == "full" or extra == "channels"
|
|
52
53
|
Requires-Dist: dask (>=2024.8.0,<2024.9.0)
|
|
53
54
|
Requires-Dist: demoji (>=1.1.0,<2.0.0)
|
|
@@ -58,8 +59,8 @@ Requires-Dist: fbmessenger (>=6.0.0,<6.1.0) ; extra == "full" or extra == "chann
|
|
|
58
59
|
Requires-Dist: github3.py (>=3.2.0,<3.3.0) ; extra == "gh-release-notes"
|
|
59
60
|
Requires-Dist: gitpython (>=3.1.41,<3.2.0) ; extra == "full"
|
|
60
61
|
Requires-Dist: gliner (>=0.2.20,<0.3.0) ; extra == "full" or extra == "pii"
|
|
61
|
-
Requires-Dist: google-auth (>=2.
|
|
62
|
-
Requires-Dist: google-cloud-storage (>=
|
|
62
|
+
Requires-Dist: google-auth (>=2.41.1,<2.42.0)
|
|
63
|
+
Requires-Dist: google-cloud-storage (>=3.4.1,<3.5.0)
|
|
63
64
|
Requires-Dist: hvac (>=2.3.0,<2.4.0)
|
|
64
65
|
Requires-Dist: importlib-metadata (>=8.5.0,<8.6.0)
|
|
65
66
|
Requires-Dist: importlib-resources (>=6.5.2,<7.0.0)
|
|
@@ -72,6 +73,7 @@ Requires-Dist: keras (>=3.11.0)
|
|
|
72
73
|
Requires-Dist: langchain (>=0.3.27,<0.4.0)
|
|
73
74
|
Requires-Dist: langchain-community (>=0.3.29,<0.4.0)
|
|
74
75
|
Requires-Dist: langcodes (>=3.5.0,<4.0.0)
|
|
76
|
+
Requires-Dist: langfuse (>=3.6.0,<3.7.0) ; extra == "full" or extra == "monitoring"
|
|
75
77
|
Requires-Dist: litellm (>=1.69.0,<1.70.0)
|
|
76
78
|
Requires-Dist: matplotlib (>=3.9.4,<3.10.0)
|
|
77
79
|
Requires-Dist: mattermostwrapper (>=2.2,<2.3) ; extra == "full" or extra == "channels"
|
|
@@ -102,13 +104,13 @@ Requires-Dist: python-dateutil (>=2.8.2,<2.9.0)
|
|
|
102
104
|
Requires-Dist: python-dotenv (>=1.0.1,<2.0.0)
|
|
103
105
|
Requires-Dist: python-engineio (>=4.12.2,<4.13.0)
|
|
104
106
|
Requires-Dist: python-keycloak (>=5.8.1,<5.9.0)
|
|
105
|
-
Requires-Dist: python-socketio (>=5.
|
|
107
|
+
Requires-Dist: python-socketio (>=5.14.0,<5.15.0)
|
|
106
108
|
Requires-Dist: pytz (>=2022.7.1,<2023.0)
|
|
107
109
|
Requires-Dist: pyyaml (>=6.0.2,<6.1.0)
|
|
108
110
|
Requires-Dist: qdrant-client (>=1.9.1,<1.10.0)
|
|
109
111
|
Requires-Dist: questionary (>=2.1.1,<2.2.0)
|
|
110
112
|
Requires-Dist: randomname (>=0.2.1,<0.3.0)
|
|
111
|
-
Requires-Dist: rasa-sdk (==3.
|
|
113
|
+
Requires-Dist: rasa-sdk (==3.15.0.dev1)
|
|
112
114
|
Requires-Dist: redis (>=4.6.0,<6.0)
|
|
113
115
|
Requires-Dist: regex (>=2024.7.24,<2024.8.0)
|
|
114
116
|
Requires-Dist: requests (>=2.32.5,<2.33.0)
|
|
@@ -125,14 +127,14 @@ Requires-Dist: scikit-learn (>=1.6.1,<1.7.0)
|
|
|
125
127
|
Requires-Dist: scipy (>=1.13.1,<1.14.0) ; python_version < "3.12"
|
|
126
128
|
Requires-Dist: scipy (>=1.14.0,<1.15.0) ; python_version >= "3.12"
|
|
127
129
|
Requires-Dist: sentencepiece (>=0.1.99,<0.2.0) ; (python_version < "3.12") and (extra == "transformers" or extra == "full" or extra == "full" or extra == "nlu")
|
|
128
|
-
Requires-Dist: sentry-sdk (>=2.
|
|
130
|
+
Requires-Dist: sentry-sdk (>=2.35.2,<2.36.0)
|
|
129
131
|
Requires-Dist: setuptools (>=78.1.1,<78.2.0)
|
|
130
132
|
Requires-Dist: sklearn-crfsuite (>=0.5.0,<0.6.0) ; extra == "full" or extra == "nlu"
|
|
131
133
|
Requires-Dist: skops (>=0.13.0,<0.14.0) ; extra == "full" or extra == "nlu"
|
|
132
|
-
Requires-Dist: slack-sdk (>=3.
|
|
134
|
+
Requires-Dist: slack-sdk (>=3.37.0,<3.38.0) ; extra == "full" or extra == "channels"
|
|
133
135
|
Requires-Dist: spacy (>=3.5.4,<4.0.0) ; extra == "spacy" or extra == "full" or extra == "nlu"
|
|
134
136
|
Requires-Dist: structlog (>=25.4.0,<25.5.0)
|
|
135
|
-
Requires-Dist: structlog-sentry (>=2.
|
|
137
|
+
Requires-Dist: structlog-sentry (>=2.2.1,<2.3.0)
|
|
136
138
|
Requires-Dist: tarsafe (>=0.0.5,<0.0.6)
|
|
137
139
|
Requires-Dist: tenacity (>=8.4.1,<8.5.0)
|
|
138
140
|
Requires-Dist: tensorflow (>=2.19.0,<3.0.0) ; (sys_platform != "darwin" or platform_machine != "arm64" and python_version < "3.12") and (extra == "full" or extra == "nlu")
|
|
@@ -147,7 +149,7 @@ Requires-Dist: tf-keras (>=2.15.0,<3.0.0) ; (python_version < "3.12") and (extra
|
|
|
147
149
|
Requires-Dist: tiktoken (>=0.9.0,<0.10.0)
|
|
148
150
|
Requires-Dist: tqdm (>=4.66.2,<5.0.0)
|
|
149
151
|
Requires-Dist: transformers (>=4.38.2,<4.39.0) ; extra == "transformers" or extra == "full" or extra == "nlu"
|
|
150
|
-
Requires-Dist: twilio (>=9.
|
|
152
|
+
Requires-Dist: twilio (>=9.8.4,<9.9.0) ; extra == "full" or extra == "channels"
|
|
151
153
|
Requires-Dist: types-cachetools (>=6.2.0.20250827,<6.3.0.0)
|
|
152
154
|
Requires-Dist: types-protobuf (==4.25.0.20240417)
|
|
153
155
|
Requires-Dist: typing-extensions (>=4.7.1,<5.0.0)
|