rasa-pro 3.13.1a8__py3-none-any.whl → 3.13.1a11__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/README.md CHANGED
@@ -115,6 +115,6 @@ Only classes that truly need state:
115
115
 
116
116
  1. **`LLMService`** - Caches schemas and manages OpenAI client
117
117
  2. **`ProjectGenerator`** - Maintains current bot files
118
- 3. **`PromptToBotService`** - Manages Sanic app and agent state
118
+ 3. **`BotBuilderService`** - Manages Sanic app and agent state
119
119
 
120
120
  Everything else uses pure functions for maximum simplicity and testability.
rasa/builder/main.py CHANGED
@@ -7,13 +7,13 @@ from typing import Optional
7
7
 
8
8
  import rasa.core.utils
9
9
  from rasa.builder.logging_utils import collecting_logs_processor
10
- from rasa.builder.service import PromptToBotService
10
+ from rasa.builder.service import BotBuilderService
11
11
  from rasa.utils.common import configure_logging_and_warnings
12
12
  from rasa.utils.log_utils import configure_structlog
13
13
  from rasa.utils.sanic_error_handler import register_custom_sanic_error_handler
14
14
 
15
15
 
16
- def setup_logging():
16
+ def setup_logging() -> None:
17
17
  """Setup logging configuration."""
18
18
  log_level = logging.DEBUG
19
19
 
@@ -31,7 +31,7 @@ def setup_logging():
31
31
  )
32
32
 
33
33
 
34
- def main(project_folder: Optional[str] = None):
34
+ def main(project_folder: Optional[str] = None) -> None:
35
35
  """Main entry point."""
36
36
  try:
37
37
  # Setup logging
@@ -39,7 +39,7 @@ def main(project_folder: Optional[str] = None):
39
39
 
40
40
  # Create and configure service
41
41
 
42
- service = PromptToBotService(project_folder)
42
+ service = BotBuilderService(project_folder)
43
43
  register_custom_sanic_error_handler(service.app)
44
44
 
45
45
  # Log available routes
rasa/builder/service.py CHANGED
@@ -1,5 +1,6 @@
1
1
  """Main service for the prompt-to-bot functionality."""
2
2
 
3
+ import os
3
4
  from typing import Optional
4
5
 
5
6
  import structlog
@@ -35,8 +36,8 @@ from rasa.shared.core.trackers import DialogueStateTracker
35
36
  structlogger = structlog.get_logger()
36
37
 
37
38
 
38
- class PromptToBotService:
39
- """Main service for prompt-to-bot functionality."""
39
+ class BotBuilderService:
40
+ """Main service for bot building functionality."""
40
41
 
41
42
  def __init__(self, project_folder: Optional[str] = None):
42
43
  """Initialize the service with a project folder for file persistence.
@@ -50,13 +51,16 @@ class PromptToBotService:
50
51
 
51
52
  project_folder = tempfile.mkdtemp(prefix="rasa_builder_")
52
53
 
54
+ # working directory needs to be the project folder, e.g.
55
+ # for relative paths (./docs) in a projects config to work
56
+ os.chdir(project_folder)
57
+
53
58
  structlogger.info(
54
- "prompt_to_bot.service_initialized", project_folder=project_folder
59
+ "bot_builder_service.service_initialized", project_folder=project_folder
55
60
  )
56
61
 
57
62
  self.project_generator = ProjectGenerator(project_folder)
58
-
59
- self.app = Sanic("PromptToBotService")
63
+ self.app = Sanic("BotBuilderService")
60
64
  self.app.config.REQUEST_TIMEOUT = 60 # 1 minute timeout
61
65
  self.app.ctx.agent = None
62
66
  self.input_channel = self.setup_input_channel()
@@ -116,7 +120,7 @@ class PromptToBotService:
116
120
 
117
121
  async def health(self, request: Request) -> HTTPResponse:
118
122
  """Health check endpoint."""
119
- return response.json({"status": "ok", "service": "prompt-to-bot"})
123
+ return response.json({"status": "ok", "service": "bot-builder"})
120
124
 
121
125
  async def handle_prompt_to_bot(self, request: Request) -> HTTPResponse:
122
126
  """Handle prompt-to-bot generation requests."""
@@ -138,7 +142,7 @@ class PromptToBotService:
138
142
  self.input_channel.agent = self.app.ctx.agent
139
143
 
140
144
  structlogger.info(
141
- "prompt_to_bot.success",
145
+ "bot_builder_service.prompt_to_bot.success",
142
146
  client_id=prompt_data.client_id,
143
147
  files_generated=list(bot_files.keys()),
144
148
  )
@@ -152,7 +156,9 @@ class PromptToBotService:
152
156
  )
153
157
 
154
158
  except ValidationError as e:
155
- structlogger.error("prompt_to_bot.validation_error", error=str(e))
159
+ structlogger.error(
160
+ "bot_builder_service.prompt_to_bot.validation_error", error=str(e)
161
+ )
156
162
  return response.json(
157
163
  ApiErrorResponse(
158
164
  error="Validation failed", details={"validation_error": str(e)}
@@ -161,7 +167,9 @@ class PromptToBotService:
161
167
  )
162
168
 
163
169
  except ProjectGenerationError as e:
164
- structlogger.error("prompt_to_bot.generation_error", error=str(e))
170
+ structlogger.error(
171
+ "bot_builder_service.prompt_to_bot.generation_error", error=str(e)
172
+ )
165
173
  return response.json(
166
174
  ApiErrorResponse(
167
175
  error="Project generation failed",
@@ -171,7 +179,9 @@ class PromptToBotService:
171
179
  )
172
180
 
173
181
  except TrainingError as e:
174
- structlogger.error("prompt_to_bot.training_error", error=str(e))
182
+ structlogger.error(
183
+ "bot_builder_service.prompt_to_bot.training_error", error=str(e)
184
+ )
175
185
  return response.json(
176
186
  ApiErrorResponse(
177
187
  error="Model training failed", details={"training_error": str(e)}
@@ -180,7 +190,9 @@ class PromptToBotService:
180
190
  )
181
191
 
182
192
  except LLMGenerationError as e:
183
- structlogger.error("prompt_to_bot.llm_error", error=str(e))
193
+ structlogger.error(
194
+ "bot_builder_service.prompt_to_bot.llm_error", error=str(e)
195
+ )
184
196
  return response.json(
185
197
  ApiErrorResponse(
186
198
  error="LLM generation failed", details={"llm_error": str(e)}
@@ -189,7 +201,9 @@ class PromptToBotService:
189
201
  )
190
202
 
191
203
  except Exception as e:
192
- structlogger.error("prompt_to_bot.unexpected_error", error=str(e))
204
+ structlogger.error(
205
+ "bot_builder_service.prompt_to_bot.unexpected_error", error=str(e)
206
+ )
193
207
  return response.json(
194
208
  ApiErrorResponse(
195
209
  error="Unexpected error occurred", details=None
@@ -217,7 +231,7 @@ class PromptToBotService:
217
231
  self.input_channel.agent = self.app.ctx.agent
218
232
 
219
233
  structlogger.info(
220
- "template_to_bot.success",
234
+ "bot_builder_service.template_to_bot.success",
221
235
  client_id=template_data.client_id,
222
236
  files_generated=list(bot_files.keys()),
223
237
  )
@@ -231,7 +245,9 @@ class PromptToBotService:
231
245
  )
232
246
 
233
247
  except ValidationError as e:
234
- structlogger.error("template_to_bot.validation_error", error=str(e))
248
+ structlogger.error(
249
+ "bot_builder_service.template_to_bot.validation_error", error=str(e)
250
+ )
235
251
  return response.json(
236
252
  ApiErrorResponse(
237
253
  error="Validation failed", details={"validation_error": str(e)}
@@ -240,7 +256,9 @@ class PromptToBotService:
240
256
  )
241
257
 
242
258
  except ProjectGenerationError as e:
243
- structlogger.error("template_to_bot.generation_error", error=str(e))
259
+ structlogger.error(
260
+ "bot_builder_service.template_to_bot.generation_error", error=str(e)
261
+ )
244
262
  return response.json(
245
263
  ApiErrorResponse(
246
264
  error="Project generation failed",
@@ -250,7 +268,9 @@ class PromptToBotService:
250
268
  )
251
269
 
252
270
  except TrainingError as e:
253
- structlogger.error("template_to_bot.training_error", error=str(e))
271
+ structlogger.error(
272
+ "bot_builder_service.template_to_bot.training_error", error=str(e)
273
+ )
254
274
  return response.json(
255
275
  ApiErrorResponse(
256
276
  error="Model training failed", details={"training_error": str(e)}
@@ -259,7 +279,9 @@ class PromptToBotService:
259
279
  )
260
280
 
261
281
  except LLMGenerationError as e:
262
- structlogger.error("template_to_bot.llm_error", error=str(e))
282
+ structlogger.error(
283
+ "bot_builder_service.template_to_bot.llm_error", error=str(e)
284
+ )
263
285
  return response.json(
264
286
  ApiErrorResponse(
265
287
  error="LLM generation failed", details={"llm_error": str(e)}
@@ -268,7 +290,9 @@ class PromptToBotService:
268
290
  )
269
291
 
270
292
  except Exception as e:
271
- structlogger.error("template_to_bot.unexpected_error", error=str(e))
293
+ structlogger.error(
294
+ "bot_builder_service.template_to_bot.unexpected_error", error=str(e)
295
+ )
272
296
  return response.json(
273
297
  ApiErrorResponse(
274
298
  error="Unexpected error occurred", details=None
@@ -410,7 +434,9 @@ class PromptToBotService:
410
434
  return response.json(llm_response)
411
435
 
412
436
  except LLMGenerationError as e:
413
- structlogger.error("llm_builder.generation_error", error=str(e))
437
+ structlogger.error(
438
+ "bot_builder_service.llm_builder.generation_error", error=str(e)
439
+ )
414
440
  return response.json(
415
441
  ApiErrorResponse(
416
442
  error="LLM helper generation failed", details={"llm_error": str(e)}
@@ -419,7 +445,9 @@ class PromptToBotService:
419
445
  )
420
446
 
421
447
  except Exception as e:
422
- structlogger.error("llm_builder.unexpected_error", error=str(e))
448
+ structlogger.error(
449
+ "bot_builder_service.llm_builder.unexpected_error", error=str(e)
450
+ )
423
451
  return response.json(
424
452
  ApiErrorResponse(
425
453
  error="Unexpected error in LLM builder",
@@ -50,6 +50,8 @@ async def train_and_load_agent(importer: TrainingDataImporter) -> agent.Agent:
50
50
  raise
51
51
  except Exception as e:
52
52
  raise TrainingError(f"Unexpected error during training: {e}")
53
+ except SystemExit as e:
54
+ raise TrainingError(f"SystemExit during training: {e}")
53
55
 
54
56
 
55
57
  async def _setup_endpoints():
@@ -70,10 +70,24 @@ async def validate_project(importer: TrainingDataImporter) -> Optional[str]:
70
70
 
71
71
  except ValidationError:
72
72
  raise
73
+
73
74
  except Exception as e:
74
75
  error_msg = f"Validation failed with exception: {e}"
76
+
77
+ error_logs = [log for log in cap_logs if log.get("log_level") != "debug"]
78
+
79
+ structlogger.error(
80
+ "validation.failed.exception", error=str(e), validation_logs=error_logs
81
+ )
82
+ raise ValidationError(error_msg, validation_logs=error_logs)
83
+
84
+ except SystemExit as e:
85
+ error_logs = [log for log in cap_logs if log.get("log_level") != "debug"]
86
+
75
87
  structlogger.error(
76
- "validation.failed.exception",
77
- error=str(e),
88
+ "validation.failed.sys_exit",
89
+ error_logs=error_logs,
90
+ )
91
+ raise ValidationError(
92
+ f"SystemExit during validation: {e}", validation_logs=error_logs
78
93
  )
79
- raise ValidationError(error_msg)
@@ -784,13 +784,15 @@ class EnterpriseSearchPolicy(LLMHealthCheckMixin, EmbeddingsHealthCheckMixin, Po
784
784
  if not os.path.exists(docs_folder) or not os.path.isdir(docs_folder):
785
785
  error_message = (
786
786
  f"Document source directory does not exist or is not a "
787
- f"directory: '{docs_folder}'. "
787
+ f"directory: '{os.path.abspath(docs_folder)}'. "
788
788
  "Please specify a valid path to the documents source directory in the "
789
789
  "vector_store configuration."
790
790
  )
791
791
  structlogger.error(
792
792
  "enterprise_search_policy.train.faiss.invalid_source_directory",
793
793
  message=error_message,
794
+ docs_folder={os.path.abspath(docs_folder)},
795
+ configuration_value=docs_folder,
794
796
  )
795
797
  print_error_and_exit(error_message)
796
798
 
@@ -1133,8 +1135,7 @@ class EnterpriseSearchPolicy(LLMHealthCheckMixin, EmbeddingsHealthCheckMixin, Po
1133
1135
  embeddings_config: Dict[Text, Any],
1134
1136
  log_source_method: str,
1135
1137
  ) -> None:
1136
- """
1137
- Perform the health checks using resolved LLM and embeddings configurations.
1138
+ """Perform the health checks using resolved LLM and embeddings configurations.
1138
1139
  Resolved means the configuration is either:
1139
1140
  - A reference to a model group that has already been expanded into
1140
1141
  its corresponding configuration using the information from
@@ -1163,8 +1164,7 @@ class EnterpriseSearchPolicy(LLMHealthCheckMixin, EmbeddingsHealthCheckMixin, Po
1163
1164
 
1164
1165
  @classmethod
1165
1166
  def get_system_default_prompt_based_on_config(cls, config: Dict[str, Any]) -> str:
1166
- """
1167
- Resolves the default prompt template for Enterprise Search Policy based on
1167
+ """Resolves the default prompt template for Enterprise Search Policy based on
1168
1168
  the component's configuration.
1169
1169
 
1170
1170
  - The old prompt is selected when both citation and relevancy check are either
@@ -1195,8 +1195,7 @@ class EnterpriseSearchPolicy(LLMHealthCheckMixin, EmbeddingsHealthCheckMixin, Po
1195
1195
  relevancy_check_enabled: bool,
1196
1196
  citation_enabled: bool,
1197
1197
  ) -> str:
1198
- """
1199
- Returns the appropriate default prompt template based on the feature flags.
1198
+ """Returns the appropriate default prompt template based on the feature flags.
1200
1199
 
1201
1200
  The selection follows this priority:
1202
1201
  1. If relevancy check is enabled, return the prompt that includes both relevancy
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.13.1a8"
3
+ __version__ = "3.13.1a11"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: rasa-pro
3
- Version: 3.13.1a8
3
+ Version: 3.13.1a11
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
@@ -1,7 +1,7 @@
1
1
  rasa/__init__.py,sha256=YXG8RzVxiSJ__v-AewtV453YoCbmzWlHsU_4S0O2XpE,206
2
2
  rasa/__main__.py,sha256=-PZSicdimOUsU-dkWu3x6eY1G6P8VwqZvB1ag02PoE8,6418
3
3
  rasa/api.py,sha256=RY3SqtlOcdq4YZGgr6DOm-nUBpiA8l8uguUZOctL_7o,6320
4
- rasa/builder/README.md,sha256=TnVfHKD-W4vcnHjGA53BMd9X7RJIeZQQe0cuCZXwFlo,3716
4
+ rasa/builder/README.md,sha256=7WYioSzBHFY25h1QCFellv7bIOW9VLH7Gf7dwQEc1k0,3715
5
5
  rasa/builder/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  rasa/builder/config.py,sha256=j1pP1nC5a2_iZMaU9qgjhbuPACSayzS_UrfTriAfPzM,2202
7
7
  rasa/builder/create_openai_vector_store.py,sha256=jAk1QzM4HiC0wjkn1031xBzLFGwVV4JUJMc50QZFIdw,6642
@@ -11,14 +11,14 @@ rasa/builder/llm_context.py,sha256=zy7htrXgS_QWJWeEj4TfseQgTI65whFJR_4GKm_iOvE,2
11
11
  rasa/builder/llm_helper_prompt.jinja2,sha256=AhfEzXYIMTmWgd2TgVmPVeCfojHA29IiuO6JhTOXXKY,9585
12
12
  rasa/builder/llm_service.py,sha256=tFtIno9V5Fq2idJ2uJt8K9b3GeO9ic2ZWWYg3rKdufw,11480
13
13
  rasa/builder/logging_utils.py,sha256=iPJoN2HhNlS14SKyZv0s0iIljrmP6A8s8C5btoDVOXM,1383
14
- rasa/builder/main.py,sha256=M_c751NEnl14jI97WSZfL7M8BKydS1Uqzdkk20DEJsk,1587
14
+ rasa/builder/main.py,sha256=1UUaBf9SUbuxDmS_bLgF5vxsiRNr_N1EOtZGYYzss1I,1601
15
15
  rasa/builder/models.py,sha256=IFsVCTIE3cUeuwxZ0MHgB9jD8T354fPPh86bZ0QrGBg,4494
16
16
  rasa/builder/project_generator.py,sha256=ZWsL3oqAIYIqJBJ8GJsLmMotgbF0ZOOMO1dQSz4xlYs,10868
17
17
  rasa/builder/scrape_rasa_docs.py,sha256=HukkTCIh1rMCE8D_EtXGHy0aHtFBVrVTT_6Wpex3XQM,2428
18
- rasa/builder/service.py,sha256=692nyowd3RkZfrKqfmw_MGorDU6F5tsTFxGDO8768A4,16512
18
+ rasa/builder/service.py,sha256=zqqB75o4pbIuSFDmjOtH2VpphV4ysrwT920eu-LC6V8,17328
19
19
  rasa/builder/skill_to_bot_prompt.jinja2,sha256=h2Fgoh9k3XinN0blEEqMuOWuvwXxJifP3GJs-GczgBU,5530
20
- rasa/builder/training_service.py,sha256=B5miGx0rcDWFVfS_SWmrpMQBJ9fYov0BBbckznstQvM,3757
21
- rasa/builder/validation_service.py,sha256=1QWGROFyblTPznYwjMnA-nRABDb8UQpDywZ11MHBThI,2292
20
+ rasa/builder/training_service.py,sha256=YSVaf6x9WuddrOruJ5BmacnRoypQVVuKZbvZq_c6xEE,3849
21
+ rasa/builder/validation_service.py,sha256=rKMgbG8Jyv8WMnTIXOMd7VuGWAYicrL9wDJ22BJXZHE,2765
22
22
  rasa/cli/__init__.py,sha256=eO5vp9rFCANtbTVU-pxN3iMBKw4p9WRcgzytt9MzinY,115
23
23
  rasa/cli/arguments/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
24
  rasa/cli/arguments/data.py,sha256=e3mYapaRIczM74P5genuXy1ORqIR4x20khQXUvy8JLA,3040
@@ -537,7 +537,7 @@ rasa/core/nlg/translate.py,sha256=PBMTbIgdkhx8rhzqv6h0u5r9jqdfiVIh7u0qb363sJA,18
537
537
  rasa/core/persistor.py,sha256=7LCZHAwCM-xrUI38aaJ5dkxJvLdJXWI1TEUKsBo4_EE,21295
538
538
  rasa/core/policies/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
539
539
  rasa/core/policies/ensemble.py,sha256=XoHxU0jcb_io_LBOpjJffylzqtGEB7CH9ivhRyO8pDc,12960
540
- rasa/core/policies/enterprise_search_policy.py,sha256=6o4KiqK_r6nNR5nJEltc0MSXemJcGqV2Dli6bxtCd2U,46872
540
+ rasa/core/policies/enterprise_search_policy.py,sha256=El7aYQCx9C2LQdMp9U5VJoBPXPL-LPe_0CD8Zf4Q7Q4,46971
541
541
  rasa/core/policies/enterprise_search_policy_config.py,sha256=rTIGBrfGfe_lvsYQW1cU20tza07p_-oxFfjXhw7-phc,8644
542
542
  rasa/core/policies/enterprise_search_prompt_template.jinja2,sha256=dCS_seyBGxMQoMsOjjvPp0dd31OSzZCJSZeev1FJK5Q,1187
543
543
  rasa/core/policies/enterprise_search_prompt_with_citation_template.jinja2,sha256=va9rpP97dN3PKoJZOVfyuISt3cPBlb10Pqyz25RwO_Q,3294
@@ -1064,9 +1064,9 @@ rasa/utils/train_utils.py,sha256=ClJx-6x3-h3Vt6mskacgkcCUJTMXjFPe3zAcy_DfmaU,212
1064
1064
  rasa/utils/url_tools.py,sha256=dZ1HGkVdWTJB7zYEdwoDIrEuyX9HE5WsxKKFVsXBLE0,1218
1065
1065
  rasa/utils/yaml.py,sha256=KjbZq5C94ZP7Jdsw8bYYF7HASI6K4-C_kdHfrnPLpSI,2000
1066
1066
  rasa/validator.py,sha256=IRhLfcgCpps0wSpokOvUGNaY8t8GsmeSmPOUVRKeOeE,83087
1067
- rasa/version.py,sha256=Kk6rjiJOtSNkytItneS5m4xxsQAru6p0cVQdtmV_ngM,119
1068
- rasa_pro-3.13.1a8.dist-info/METADATA,sha256=j-GngwbEl1EV7kE_tSNCs6Dr6GzgXxoxbDKwoS5v2kM,10555
1069
- rasa_pro-3.13.1a8.dist-info/NOTICE,sha256=7HlBoMHJY9CL2GlYSfTQ-PZsVmLmVkYmMiPlTjhuCqA,218
1070
- rasa_pro-3.13.1a8.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
1071
- rasa_pro-3.13.1a8.dist-info/entry_points.txt,sha256=ckJ2SfEyTPgBqj_I6vm_tqY9dZF_LAPJZA335Xp0Q9U,43
1072
- rasa_pro-3.13.1a8.dist-info/RECORD,,
1067
+ rasa/version.py,sha256=ENw9GTVfrFnSYDXb0bIJL1zIkbfuxEbcaJ2K17qc_jY,120
1068
+ rasa_pro-3.13.1a11.dist-info/METADATA,sha256=os010xxGInSuAWsuGxV98gIW_MEuv__Jb5lueihJKXI,10556
1069
+ rasa_pro-3.13.1a11.dist-info/NOTICE,sha256=7HlBoMHJY9CL2GlYSfTQ-PZsVmLmVkYmMiPlTjhuCqA,218
1070
+ rasa_pro-3.13.1a11.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
1071
+ rasa_pro-3.13.1a11.dist-info/entry_points.txt,sha256=ckJ2SfEyTPgBqj_I6vm_tqY9dZF_LAPJZA335Xp0Q9U,43
1072
+ rasa_pro-3.13.1a11.dist-info/RECORD,,