rasa-pro 3.14.0rc3__py3-none-any.whl → 3.14.1__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.

Files changed (55) hide show
  1. rasa/agents/agent_manager.py +7 -5
  2. rasa/agents/protocol/a2a/a2a_agent.py +13 -11
  3. rasa/agents/protocol/mcp/mcp_base_agent.py +64 -12
  4. rasa/agents/validation.py +61 -6
  5. rasa/builder/copilot/constants.py +4 -0
  6. rasa/builder/copilot/copilot_templated_message_provider.py +24 -1
  7. rasa/builder/copilot/templated_messages/copilot_templated_responses.yml +3 -0
  8. rasa/builder/copilot/templated_messages/copilot_welcome_messages.yml +56 -0
  9. rasa/builder/jobs.py +162 -5
  10. rasa/builder/models.py +3 -0
  11. rasa/builder/validation_service.py +4 -0
  12. rasa/cli/arguments/data.py +9 -0
  13. rasa/cli/data.py +72 -6
  14. rasa/cli/interactive.py +3 -0
  15. rasa/cli/llm_fine_tuning.py +1 -0
  16. rasa/cli/project_templates/defaults.py +1 -0
  17. rasa/cli/validation/bot_config.py +4 -0
  18. rasa/constants.py +1 -1
  19. rasa/core/actions/action_exceptions.py +1 -1
  20. rasa/core/agent.py +4 -1
  21. rasa/core/available_agents.py +1 -1
  22. rasa/core/config/available_endpoints.py +6 -0
  23. rasa/core/exceptions.py +1 -1
  24. rasa/core/featurizers/tracker_featurizers.py +3 -2
  25. rasa/core/persistor.py +7 -7
  26. rasa/core/policies/flows/agent_executor.py +84 -4
  27. rasa/core/policies/flows/flow_exceptions.py +5 -2
  28. rasa/core/policies/flows/flow_executor.py +3 -2
  29. rasa/core/policies/flows/mcp_tool_executor.py +7 -1
  30. rasa/core/policies/rule_policy.py +1 -1
  31. rasa/dialogue_understanding/commands/cancel_flow_command.py +1 -1
  32. rasa/dialogue_understanding/patterns/default_flows_for_patterns.yml +22 -20
  33. rasa/engine/validation.py +6 -2
  34. rasa/model_manager/runner_service.py +1 -1
  35. rasa/privacy/privacy_config.py +1 -1
  36. rasa/shared/agents/auth/auth_strategy/oauth2_auth_strategy.py +4 -7
  37. rasa/shared/agents/auth/utils.py +85 -0
  38. rasa/shared/constants.py +3 -0
  39. rasa/shared/core/training_data/story_reader/story_reader.py +1 -1
  40. rasa/shared/exceptions.py +23 -2
  41. rasa/shared/providers/llm/litellm_router_llm_client.py +2 -2
  42. rasa/shared/utils/llm.py +54 -4
  43. rasa/shared/utils/mcp/server_connection.py +7 -4
  44. rasa/studio/download.py +3 -0
  45. rasa/studio/prompts.py +1 -0
  46. rasa/studio/upload.py +4 -0
  47. rasa/utils/log_utils.py +20 -1
  48. rasa/utils/pypred.py +7 -0
  49. rasa/validator.py +90 -2
  50. rasa/version.py +1 -1
  51. {rasa_pro-3.14.0rc3.dist-info → rasa_pro-3.14.1.dist-info}/METADATA +8 -7
  52. {rasa_pro-3.14.0rc3.dist-info → rasa_pro-3.14.1.dist-info}/RECORD +55 -53
  53. {rasa_pro-3.14.0rc3.dist-info → rasa_pro-3.14.1.dist-info}/NOTICE +0 -0
  54. {rasa_pro-3.14.0rc3.dist-info → rasa_pro-3.14.1.dist-info}/WHEEL +0 -0
  55. {rasa_pro-3.14.0rc3.dist-info → rasa_pro-3.14.1.dist-info}/entry_points.txt +0 -0
@@ -121,7 +121,8 @@ class MCPServerConnection:
121
121
  except Exception as eg:
122
122
  for exc in getattr(eg, "exceptions", [eg]):
123
123
  event_info = (
124
- f"Failed to connect to MCP server `{self.server_name}`: {exc!s}"
124
+ f"Failed to connect to MCP server `{self.server_name}`. \nOriginal "
125
+ f"error: {exc!s}"
125
126
  )
126
127
  if isinstance(exc, HTTPStatusError):
127
128
  status_code = exc.response.status_code
@@ -135,9 +136,11 @@ class MCPServerConnection:
135
136
  )
136
137
  await self._cleanup()
137
138
  if status_code in [400, 401, 403]:
138
- raise AuthenticationError(eg) from eg
139
+ raise AuthenticationError(str(exc)) from eg
140
+ elif status_code == 404:
141
+ raise Exception(str(exc)) from eg
139
142
  else:
140
- raise ConnectionError(eg) from eg
143
+ raise ConnectionError(str(exc)) from eg
141
144
  else:
142
145
  structlogger.error(
143
146
  "mcp_server_connection.connect.other_exception",
@@ -147,7 +150,7 @@ class MCPServerConnection:
147
150
  error=str(exc),
148
151
  )
149
152
  await self._cleanup()
150
- raise ConnectionError(eg) from eg
153
+ raise ConnectionError(str(exc)) from eg
151
154
 
152
155
  except asyncio.CancelledError as e:
153
156
  event_info = f"Connection to MCP server `{self.server_name}` was cancelled."
rasa/studio/download.py CHANGED
@@ -10,6 +10,7 @@ from ruamel.yaml.scalarstring import LiteralScalarString
10
10
 
11
11
  import rasa.cli.utils
12
12
  import rasa.shared.utils.cli
13
+ from rasa.core.config.configuration import Configuration
13
14
  from rasa.shared.constants import (
14
15
  DEFAULT_CONFIG_PATH,
15
16
  DEFAULT_DATA_PATH,
@@ -116,6 +117,8 @@ def _handle_endpoints(handler: StudioDataHandler, root: Path) -> None:
116
117
  endpoints_path = root / DEFAULT_ENDPOINTS_PATH
117
118
  endpoints_path.write_text(endpoints_data, encoding="utf-8")
118
119
 
120
+ Configuration.initialise_endpoints(endpoints_path=endpoints_path)
121
+
119
122
 
120
123
  def _handle_domain(handler: StudioDataHandler, root: Path) -> None:
121
124
  """Persist the assistant’s domain file.
rasa/studio/prompts.py CHANGED
@@ -43,6 +43,7 @@ def handle_prompts(prompts: Dict[Text, Text], root: Path) -> None:
43
43
  config: Dict = read_yaml(config_path)
44
44
  endpoints: Dict = read_yaml(endpoints_path)
45
45
 
46
+ # System default prompts are dependent on the endpoints
46
47
  system_prompts = get_system_default_prompts(config, endpoints)
47
48
 
48
49
  _handle_contextual_response_rephraser(
rasa/studio/upload.py CHANGED
@@ -154,6 +154,10 @@ def handle_upload(args: argparse.Namespace) -> None:
154
154
  "Authentication is invalid or expired. Please run `rasa studio login`."
155
155
  )
156
156
 
157
+ from rasa.core.config.configuration import Configuration
158
+
159
+ Configuration.initialise_empty()
160
+
157
161
  structlogger.info("rasa.studio.upload.loading_data", event_info="Loading data...")
158
162
 
159
163
  args.domain = get_validated_path(args.domain, "domain", DEFAULT_DOMAIN_PATHS)
rasa/utils/log_utils.py CHANGED
@@ -23,6 +23,25 @@ ANSI_CYAN_BOLD = "\033[1;36m"
23
23
  ANSI_RESET = "\033[0m"
24
24
 
25
25
 
26
+ def conditional_set_exc_info(
27
+ logger: WrappedLogger, name: str, event_dict: EventDict
28
+ ) -> EventDict:
29
+ """Set exception info only if exception does not have suppress_stack_trace flag."""
30
+ exc_info = event_dict.get("exc_info")
31
+ if exc_info is not None:
32
+ is_debug_mode = logger.isEnabledFor(logging.DEBUG)
33
+
34
+ if (
35
+ hasattr(exc_info, "suppress_stack_trace")
36
+ and exc_info.suppress_stack_trace
37
+ and not is_debug_mode
38
+ ):
39
+ event_dict.pop("exc_info", None)
40
+ else:
41
+ return structlog.dev.set_exc_info(logger, name, event_dict)
42
+ return event_dict
43
+
44
+
26
45
  class HumanConsoleRenderer(ConsoleRenderer):
27
46
  """Console renderer that outputs human-readable logs."""
28
47
 
@@ -158,7 +177,7 @@ def configure_structlog(
158
177
  structlog.processors.StackInfoRenderer(),
159
178
  # If some value is in bytes, decode it to a unicode str.
160
179
  structlog.processors.UnicodeDecoder(),
161
- structlog.dev.set_exc_info,
180
+ conditional_set_exc_info,
162
181
  # add structlog sentry integration. only log fatal log entries
163
182
  # as events as we are tracking exceptions anyways
164
183
  SentryProcessor(event_level=logging.FATAL),
rasa/utils/pypred.py CHANGED
@@ -10,6 +10,7 @@ https://rasahq.atlassian.net/browse/ATO-1925
10
10
  The solution is based on https://github.com/FreeCAD/FreeCAD/issues/6315
11
11
  """
12
12
 
13
+ import logging
13
14
  from typing import Any
14
15
 
15
16
  import ply.yacc
@@ -19,12 +20,18 @@ from pypred import Predicate as OriginalPredicate # noqa: TID251
19
20
  # Store the original yacc function
20
21
  _original_yacc = ply.yacc.yacc
21
22
 
23
+ # Create a logger that suppresses warnings to avoid yacc table file version warnings
24
+ _yacc_logger = logging.getLogger("ply.yacc")
25
+ _yacc_logger.setLevel(logging.ERROR)
26
+
22
27
 
23
28
  def patched_yacc(*args: Any, **kwargs: Any) -> Any:
24
29
  # Disable generation of debug ('parser.out') and table
25
30
  # cache ('parsetab.py'), as it requires a writable location.
26
31
  kwargs["write_tables"] = False
27
32
  kwargs["module"] = pypred.parser
33
+ # Suppress yacc warnings by using a logger that only shows errors
34
+ kwargs["errorlog"] = _yacc_logger
28
35
  return _original_yacc(*args, **kwargs)
29
36
 
30
37
 
rasa/validator.py CHANGED
@@ -4,14 +4,13 @@ import string
4
4
  from collections import defaultdict
5
5
  from typing import Any, Dict, List, Optional, Set, Text, Tuple
6
6
 
7
+ import jinja2.exceptions
7
8
  import structlog
8
9
  from jinja2 import Template
9
10
  from pypred.ast import CompareOperator, Literal, NegateOperator
10
11
 
11
12
  import rasa.core.training.story_conflict
12
13
  import rasa.shared.nlu.constants
13
- import rasa.shared.utils.cli
14
- import rasa.shared.utils.io
15
14
  from rasa.agents.validation import validate_agent_names_not_conflicting_with_flows
16
15
  from rasa.core.channels import UserMessage
17
16
  from rasa.core.config.configuration import Configuration
@@ -1977,6 +1976,95 @@ class Validator:
1977
1976
 
1978
1977
  return all_good
1979
1978
 
1979
+ def verify_prompt_templates(self) -> bool:
1980
+ """Verify that all prompt templates have valid Jinja2 syntax.
1981
+
1982
+ Returns:
1983
+ True if all templates are valid, False otherwise.
1984
+ """
1985
+ all_good = True
1986
+
1987
+ # Check the components in the pipeline and policies for prompt templates
1988
+ pipeline = self.config.get(CONFIG_PIPELINE_KEY, [])
1989
+ for component in pipeline:
1990
+ if isinstance(component, dict):
1991
+ component_name = component.get("name", "")
1992
+ prompt_template = component.get("prompt_template")
1993
+ if prompt_template:
1994
+ all_good = (
1995
+ self._validate_template_file(
1996
+ prompt_template, component_name, "pipeline component"
1997
+ )
1998
+ and all_good
1999
+ )
2000
+
2001
+ # Check policies for prompt templates
2002
+ policies = self.config.get("policies") or []
2003
+ for policy in policies:
2004
+ if isinstance(policy, dict):
2005
+ policy_name = policy.get("name", "")
2006
+ prompt_template = policy.get("prompt_template")
2007
+ if prompt_template:
2008
+ all_good = (
2009
+ self._validate_template_file(
2010
+ prompt_template, policy_name, "policy"
2011
+ )
2012
+ and all_good
2013
+ )
2014
+
2015
+ return all_good
2016
+
2017
+ def _validate_template_file(
2018
+ self, prompt_template: str, component_name: str, component_type: str
2019
+ ) -> bool:
2020
+ """Validate a single prompt template file.
2021
+
2022
+ Args:
2023
+ prompt_template: The template file path to validate
2024
+ component_name: Name of the component using the template
2025
+ component_type: Type of component (e.g., "policy", "pipeline component")
2026
+
2027
+ Returns:
2028
+ True if template is valid, False otherwise.
2029
+ """
2030
+ try:
2031
+ # Use a simple default template, as we're assuming
2032
+ # that the default templates are valid
2033
+ default_template = "{{ content }}"
2034
+ template_content = rasa.shared.utils.llm.get_prompt_template(
2035
+ prompt_template,
2036
+ default_template,
2037
+ log_source_component=f"validator.{component_name}",
2038
+ log_source_method="init",
2039
+ )
2040
+
2041
+ # Validate Jinja2 syntax using the shared validation function
2042
+ rasa.shared.utils.llm.validate_jinja2_template(template_content)
2043
+ return True
2044
+ except jinja2.exceptions.TemplateSyntaxError as e:
2045
+ structlogger.error(
2046
+ "validator.verify_prompt_templates.syntax_error",
2047
+ component=component_name,
2048
+ component_type=component_type,
2049
+ event_info=(
2050
+ f"Invalid Jinja2 template syntax in file {prompt_template} "
2051
+ f"at line {e.lineno}: {e.message}"
2052
+ ),
2053
+ error=str(e),
2054
+ template_line=e.lineno,
2055
+ template_file=prompt_template,
2056
+ )
2057
+ return False
2058
+ except Exception as e:
2059
+ structlogger.error(
2060
+ "validator.verify_prompt_templates.error",
2061
+ component=component_name,
2062
+ component_type=component_type,
2063
+ event_info=f"Error validating prompt template: {e}",
2064
+ error=str(e),
2065
+ )
2066
+ return False
2067
+
1980
2068
  def validate_conditional_response_variation_predicates(self) -> bool:
1981
2069
  """Validate the conditional response variation predicates."""
1982
2070
  context = {SLOTS: {slot.name: None for slot in self.domain.slots}}
rasa/version.py CHANGED
@@ -1,3 +1,3 @@
1
1
  # this file will automatically be changed,
2
2
  # do not add anything but the version number here!
3
- __version__ = "3.14.0rc3"
3
+ __version__ = "3.14.1"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: rasa-pro
3
- Version: 3.14.0rc3
3
+ Version: 3.14.1
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
@@ -29,19 +29,19 @@ Requires-Dist: CacheControl (>=0.14.2,<0.15.0)
29
29
  Requires-Dist: PyJWT[crypto] (>=2.8.0,<3.0.0)
30
30
  Requires-Dist: SQLAlchemy (>=2.0.42,<2.1.0)
31
31
  Requires-Dist: a2a-sdk (>=0.3.4,<0.4.0)
32
- Requires-Dist: absl-py (>=2.0,<2.1)
32
+ Requires-Dist: absl-py (>=2.3.1,<2.4)
33
33
  Requires-Dist: aio-pika (>=8.2.3,<9.4.4)
34
34
  Requires-Dist: aiogram (>=3.22.0,<3.23.0) ; extra == "full" or extra == "channels"
35
35
  Requires-Dist: aiohttp (>=3.10,<3.11)
36
36
  Requires-Dist: aioshutil (>=1.5,<1.6)
37
- Requires-Dist: apscheduler (>=3.10,<3.11)
37
+ Requires-Dist: apscheduler (>=3.11,<3.12)
38
38
  Requires-Dist: attrs (>=23.1,<25.0)
39
39
  Requires-Dist: audioop-lts (>=0.2.2,<0.3.0) ; python_version >= "3.13"
40
40
  Requires-Dist: aws-msk-iam-sasl-signer-python (>=1.0.2,<1.1.0)
41
41
  Requires-Dist: azure-identity (>=1.24.0,<1.25.0)
42
42
  Requires-Dist: azure-storage-blob (>=12.26.0,<12.27.0)
43
43
  Requires-Dist: boto3 (>=1.40.21,<1.41.0)
44
- Requires-Dist: certifi (>=2024.07.04)
44
+ Requires-Dist: certifi (>=2025.10.5,<2025.11.0)
45
45
  Requires-Dist: colorama (>=0.4.6,<0.5.0) ; sys_platform == "win32"
46
46
  Requires-Dist: colorclass (>=2.2,<2.3)
47
47
  Requires-Dist: coloredlogs (>=15,<16)
@@ -68,6 +68,7 @@ Requires-Dist: jinja2 (>=3.1.6,<3.2.0)
68
68
  Requires-Dist: jsonpatch (>=1.33,<2.0)
69
69
  Requires-Dist: jsonpickle (>=3.3.0,<3.4)
70
70
  Requires-Dist: jsonschema (>=4.22)
71
+ Requires-Dist: keras (>=3.11.0)
71
72
  Requires-Dist: langchain (>=0.3.27,<0.4.0)
72
73
  Requires-Dist: langchain-community (>=0.3.29,<0.4.0)
73
74
  Requires-Dist: langcodes (>=3.5.0,<4.0.0)
@@ -105,13 +106,13 @@ Requires-Dist: python-socketio (>=5.13,<6)
105
106
  Requires-Dist: pytz (>=2022.7.1,<2023.0)
106
107
  Requires-Dist: pyyaml (>=6.0.2,<6.1.0)
107
108
  Requires-Dist: qdrant-client (>=1.9.1,<1.10.0)
108
- Requires-Dist: questionary (>=1.10.0,<2.1.0)
109
+ Requires-Dist: questionary (>=2.1.1,<2.2.0)
109
110
  Requires-Dist: randomname (>=0.2.1,<0.3.0)
110
- Requires-Dist: rasa-sdk (==3.14.0rc1)
111
+ Requires-Dist: rasa-sdk (==3.14.0)
111
112
  Requires-Dist: redis (>=4.6.0,<6.0)
112
113
  Requires-Dist: regex (>=2024.7.24,<2024.8.0)
113
114
  Requires-Dist: requests (>=2.32.5,<2.33.0)
114
- Requires-Dist: rich (>=13.4.2,<14.0.0)
115
+ Requires-Dist: rich (>=14.1.0,<14.2.0)
115
116
  Requires-Dist: rocketchat_API (>=1.32.0,<1.33.0) ; extra == "full" or extra == "channels"
116
117
  Requires-Dist: ruamel.yaml (>=0.17.21,<0.17.22)
117
118
  Requires-Dist: safetensors (>=0.4.5,<0.5.0)