rasa-pro 3.13.1a7__py3-none-any.whl → 3.13.1a8__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/project_generator.py +20 -8
- rasa/builder/service.py +32 -19
- rasa/core/channels/studio_chat.py +4 -2
- rasa/version.py +1 -1
- {rasa_pro-3.13.1a7.dist-info → rasa_pro-3.13.1a8.dist-info}/METADATA +1 -1
- {rasa_pro-3.13.1a7.dist-info → rasa_pro-3.13.1a8.dist-info}/RECORD +9 -9
- {rasa_pro-3.13.1a7.dist-info → rasa_pro-3.13.1a8.dist-info}/NOTICE +0 -0
- {rasa_pro-3.13.1a7.dist-info → rasa_pro-3.13.1a8.dist-info}/WHEEL +0 -0
- {rasa_pro-3.13.1a7.dist-info → rasa_pro-3.13.1a8.dist-info}/entry_points.txt +0 -0
|
@@ -44,7 +44,7 @@ class ProjectGenerator:
|
|
|
44
44
|
skill_description: str,
|
|
45
45
|
template: ProjectTemplateName,
|
|
46
46
|
max_retries: Optional[int] = None,
|
|
47
|
-
) -> Dict[str, str]:
|
|
47
|
+
) -> Dict[str, Optional[str]]:
|
|
48
48
|
"""Generate a Rasa project with retry logic for validation failures.
|
|
49
49
|
|
|
50
50
|
Args:
|
|
@@ -72,7 +72,7 @@ class ProjectGenerator:
|
|
|
72
72
|
|
|
73
73
|
async def _generate_with_retry(
|
|
74
74
|
messages: List[Dict[str, Any]], attempts_left: int
|
|
75
|
-
):
|
|
75
|
+
) -> Dict[str, Optional[str]]:
|
|
76
76
|
try:
|
|
77
77
|
# Generate project data using LLM
|
|
78
78
|
project_data = await llm_service.generate_rasa_project(messages)
|
|
@@ -178,7 +178,7 @@ class ProjectGenerator:
|
|
|
178
178
|
except Exception as e:
|
|
179
179
|
raise ValidationError(f"Failed to create importer: {e}")
|
|
180
180
|
|
|
181
|
-
def get_bot_files(self) -> Dict[str, str]:
|
|
181
|
+
def get_bot_files(self) -> Dict[str, Optional[str]]:
|
|
182
182
|
"""Get the current bot files by reading from disk."""
|
|
183
183
|
bot_files = {}
|
|
184
184
|
|
|
@@ -190,15 +190,27 @@ class ProjectGenerator:
|
|
|
190
190
|
relative_path = file.relative_to(self.project_folder)
|
|
191
191
|
|
|
192
192
|
# Skip hidden files and directories (any path component starting with '.')
|
|
193
|
+
# as well as `__pycache__` folders
|
|
193
194
|
if any(part.startswith(".") for part in relative_path.parts):
|
|
194
195
|
continue
|
|
195
196
|
|
|
197
|
+
if "__pycache__" in relative_path.parts:
|
|
198
|
+
continue
|
|
199
|
+
|
|
196
200
|
# exclude the project_folder / models folder
|
|
197
201
|
if relative_path.parts[0] == "models":
|
|
198
202
|
continue
|
|
199
203
|
|
|
200
204
|
# Read file content and store with relative path as key
|
|
201
|
-
|
|
205
|
+
try:
|
|
206
|
+
bot_files[relative_path.as_posix()] = file.read_text(encoding="utf-8")
|
|
207
|
+
except Exception as e:
|
|
208
|
+
structlogger.debug(
|
|
209
|
+
"project_generator.get_bot_files.error",
|
|
210
|
+
error=str(e),
|
|
211
|
+
file_path=file.as_posix(),
|
|
212
|
+
)
|
|
213
|
+
bot_files[relative_path.as_posix()] = None
|
|
202
214
|
|
|
203
215
|
return bot_files
|
|
204
216
|
|
|
@@ -223,7 +235,7 @@ class ProjectGenerator:
|
|
|
223
235
|
else:
|
|
224
236
|
return f"data/flows/{flow_id}.yml"
|
|
225
237
|
|
|
226
|
-
def _update_bot_files_from_llm_response(self, project_data: Dict[str, Any]):
|
|
238
|
+
def _update_bot_files_from_llm_response(self, project_data: Dict[str, Any]) -> None:
|
|
227
239
|
"""Update the bot files with generated data by writing to disk."""
|
|
228
240
|
files = {"domain.yml": dump_obj_as_yaml_to_string(project_data["domain"])}
|
|
229
241
|
# split up flows into one file per flow in the /flows folder
|
|
@@ -236,21 +248,21 @@ class ProjectGenerator:
|
|
|
236
248
|
self._cleanup_flows()
|
|
237
249
|
self.update_bot_files(files)
|
|
238
250
|
|
|
239
|
-
def _cleanup_flows(self):
|
|
251
|
+
def _cleanup_flows(self) -> None:
|
|
240
252
|
"""Cleanup the flows folder."""
|
|
241
253
|
flows_folder = self.project_folder / "data" / "flows"
|
|
242
254
|
if flows_folder.exists():
|
|
243
255
|
shutil.rmtree(flows_folder)
|
|
244
256
|
flows_folder.mkdir(parents=True, exist_ok=True)
|
|
245
257
|
|
|
246
|
-
def update_bot_files(self, files: Dict[str, str]):
|
|
258
|
+
def update_bot_files(self, files: Dict[str, str]) -> None:
|
|
247
259
|
"""Update bot files with new content by writing to disk."""
|
|
248
260
|
for filename, content in files.items():
|
|
249
261
|
file_path = Path(subpath(self.project_folder, filename))
|
|
250
262
|
file_path.parent.mkdir(parents=True, exist_ok=True)
|
|
251
263
|
file_path.write_text(content, encoding="utf-8")
|
|
252
264
|
|
|
253
|
-
def cleanup(self):
|
|
265
|
+
def cleanup(self) -> None:
|
|
254
266
|
"""Cleanup the project folder."""
|
|
255
267
|
# remove all the files and folders in the project folder resulting
|
|
256
268
|
# in an empty folder
|
rasa/builder/service.py
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
from typing import Optional
|
|
4
4
|
|
|
5
5
|
import structlog
|
|
6
|
-
from sanic import Sanic, response
|
|
6
|
+
from sanic import HTTPResponse, Sanic, response
|
|
7
7
|
from sanic.request import Request
|
|
8
8
|
|
|
9
9
|
from rasa.builder import config
|
|
@@ -72,7 +72,7 @@ class PromptToBotService:
|
|
|
72
72
|
)
|
|
73
73
|
return StudioChatInput.from_credentials(credentials=studio_chat_credentials)
|
|
74
74
|
|
|
75
|
-
def setup_routes(self):
|
|
75
|
+
def setup_routes(self) -> None:
|
|
76
76
|
"""Setup all API routes."""
|
|
77
77
|
# Core endpoints
|
|
78
78
|
self.app.add_route(
|
|
@@ -93,11 +93,11 @@ class PromptToBotService:
|
|
|
93
93
|
|
|
94
94
|
channels.channel.register([self.input_channel], self.app, route="/webhooks/")
|
|
95
95
|
|
|
96
|
-
def setup_middleware(self):
|
|
96
|
+
def setup_middleware(self) -> None:
|
|
97
97
|
"""Setup middleware for request/response processing."""
|
|
98
98
|
|
|
99
|
-
@self.app.middleware("request")
|
|
100
|
-
async def log_request(request):
|
|
99
|
+
@self.app.middleware("request") # type: ignore[no-untyped-call]
|
|
100
|
+
async def log_request(request: Request) -> None:
|
|
101
101
|
structlogger.info(
|
|
102
102
|
"request.received",
|
|
103
103
|
method=request.method,
|
|
@@ -105,8 +105,8 @@ class PromptToBotService:
|
|
|
105
105
|
remote_addr=request.remote_addr or "unknown",
|
|
106
106
|
)
|
|
107
107
|
|
|
108
|
-
@self.app.middleware("response")
|
|
109
|
-
async def log_response(request, response):
|
|
108
|
+
@self.app.middleware("response") # type: ignore[no-untyped-call]
|
|
109
|
+
async def log_response(request: Request, response: HTTPResponse) -> None:
|
|
110
110
|
structlogger.info(
|
|
111
111
|
"request.completed",
|
|
112
112
|
method=request.method,
|
|
@@ -114,11 +114,11 @@ class PromptToBotService:
|
|
|
114
114
|
status=response.status,
|
|
115
115
|
)
|
|
116
116
|
|
|
117
|
-
async def health(self, request: Request):
|
|
117
|
+
async def health(self, request: Request) -> HTTPResponse:
|
|
118
118
|
"""Health check endpoint."""
|
|
119
119
|
return response.json({"status": "ok", "service": "prompt-to-bot"})
|
|
120
120
|
|
|
121
|
-
async def handle_prompt_to_bot(self, request: Request):
|
|
121
|
+
async def handle_prompt_to_bot(self, request: Request) -> HTTPResponse:
|
|
122
122
|
"""Handle prompt-to-bot generation requests."""
|
|
123
123
|
try:
|
|
124
124
|
# Validate request
|
|
@@ -191,11 +191,13 @@ class PromptToBotService:
|
|
|
191
191
|
except Exception as e:
|
|
192
192
|
structlogger.error("prompt_to_bot.unexpected_error", error=str(e))
|
|
193
193
|
return response.json(
|
|
194
|
-
ApiErrorResponse(
|
|
194
|
+
ApiErrorResponse(
|
|
195
|
+
error="Unexpected error occurred", details=None
|
|
196
|
+
).model_dump(),
|
|
195
197
|
status=500,
|
|
196
198
|
)
|
|
197
199
|
|
|
198
|
-
async def handle_template_to_bot(self, request: Request):
|
|
200
|
+
async def handle_template_to_bot(self, request: Request) -> HTTPResponse:
|
|
199
201
|
"""Handle template-to-bot generation requests."""
|
|
200
202
|
try:
|
|
201
203
|
# Validate request
|
|
@@ -268,18 +270,24 @@ class PromptToBotService:
|
|
|
268
270
|
except Exception as e:
|
|
269
271
|
structlogger.error("template_to_bot.unexpected_error", error=str(e))
|
|
270
272
|
return response.json(
|
|
271
|
-
ApiErrorResponse(
|
|
273
|
+
ApiErrorResponse(
|
|
274
|
+
error="Unexpected error occurred", details=None
|
|
275
|
+
).model_dump(),
|
|
272
276
|
status=500,
|
|
273
277
|
)
|
|
274
278
|
|
|
275
|
-
async def get_bot_data(self, request: Request):
|
|
279
|
+
async def get_bot_data(self, request: Request) -> HTTPResponse:
|
|
276
280
|
"""Get current bot data."""
|
|
277
281
|
bot_files = self.project_generator.get_bot_files()
|
|
278
282
|
return response.json(
|
|
279
|
-
ApiResponse(
|
|
283
|
+
ApiResponse(
|
|
284
|
+
status="success",
|
|
285
|
+
message="Bot data fetched successfully",
|
|
286
|
+
data={"bot_data": bot_files},
|
|
287
|
+
).model_dump()
|
|
280
288
|
)
|
|
281
289
|
|
|
282
|
-
async def update_bot_data(self, request: Request):
|
|
290
|
+
async def update_bot_data(self, request: Request) -> None:
|
|
283
291
|
"""Update bot data with server-sent events for progress tracking."""
|
|
284
292
|
sse_response = await request.respond(content_type="text/event-stream")
|
|
285
293
|
|
|
@@ -376,7 +384,7 @@ class PromptToBotService:
|
|
|
376
384
|
finally:
|
|
377
385
|
await sse_response.eof()
|
|
378
386
|
|
|
379
|
-
async def llm_builder(self, request: Request):
|
|
387
|
+
async def llm_builder(self, request: Request) -> HTTPResponse:
|
|
380
388
|
"""Handle LLM builder requests."""
|
|
381
389
|
try:
|
|
382
390
|
# Validate request
|
|
@@ -413,7 +421,10 @@ class PromptToBotService:
|
|
|
413
421
|
except Exception as e:
|
|
414
422
|
structlogger.error("llm_builder.unexpected_error", error=str(e))
|
|
415
423
|
return response.json(
|
|
416
|
-
ApiErrorResponse(
|
|
424
|
+
ApiErrorResponse(
|
|
425
|
+
error="Unexpected error in LLM builder",
|
|
426
|
+
details=None,
|
|
427
|
+
).model_dump(),
|
|
417
428
|
status=500,
|
|
418
429
|
)
|
|
419
430
|
|
|
@@ -429,11 +440,13 @@ class PromptToBotService:
|
|
|
429
440
|
return None
|
|
430
441
|
|
|
431
442
|
@staticmethod
|
|
432
|
-
async def _send_sse_event(
|
|
443
|
+
async def _send_sse_event(
|
|
444
|
+
sse_response: HTTPResponse, event: ServerSentEvent
|
|
445
|
+
) -> None:
|
|
433
446
|
"""Send a server-sent event."""
|
|
434
447
|
await sse_response.send(event.format())
|
|
435
448
|
|
|
436
|
-
def run(self):
|
|
449
|
+
def run(self) -> None:
|
|
437
450
|
"""Run the service."""
|
|
438
451
|
structlogger.info(
|
|
439
452
|
"service.starting",
|
|
@@ -42,7 +42,7 @@ if TYPE_CHECKING:
|
|
|
42
42
|
from sanic import Sanic, Websocket # type: ignore[attr-defined]
|
|
43
43
|
from socketio import AsyncServer
|
|
44
44
|
|
|
45
|
-
from rasa.core.channels.channel import
|
|
45
|
+
from rasa.core.channels.channel import UserMessage
|
|
46
46
|
from rasa.shared.core.trackers import DialogueStateTracker
|
|
47
47
|
|
|
48
48
|
|
|
@@ -181,7 +181,9 @@ class StudioChatInput(SocketIOInput, VoiceInputChannel):
|
|
|
181
181
|
self._register_tracker_update_hook()
|
|
182
182
|
|
|
183
183
|
@classmethod
|
|
184
|
-
def from_credentials(
|
|
184
|
+
def from_credentials(
|
|
185
|
+
cls, credentials: Optional[Dict[Text, Any]]
|
|
186
|
+
) -> "StudioChatInput":
|
|
185
187
|
"""Creates a StudioChatInput channel from credentials."""
|
|
186
188
|
credentials = credentials or {}
|
|
187
189
|
|
rasa/version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: rasa-pro
|
|
3
|
-
Version: 3.13.
|
|
3
|
+
Version: 3.13.1a8
|
|
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
|
|
@@ -13,9 +13,9 @@ rasa/builder/llm_service.py,sha256=tFtIno9V5Fq2idJ2uJt8K9b3GeO9ic2ZWWYg3rKdufw,1
|
|
|
13
13
|
rasa/builder/logging_utils.py,sha256=iPJoN2HhNlS14SKyZv0s0iIljrmP6A8s8C5btoDVOXM,1383
|
|
14
14
|
rasa/builder/main.py,sha256=M_c751NEnl14jI97WSZfL7M8BKydS1Uqzdkk20DEJsk,1587
|
|
15
15
|
rasa/builder/models.py,sha256=IFsVCTIE3cUeuwxZ0MHgB9jD8T354fPPh86bZ0QrGBg,4494
|
|
16
|
-
rasa/builder/project_generator.py,sha256=
|
|
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=
|
|
18
|
+
rasa/builder/service.py,sha256=692nyowd3RkZfrKqfmw_MGorDU6F5tsTFxGDO8768A4,16512
|
|
19
19
|
rasa/builder/skill_to_bot_prompt.jinja2,sha256=h2Fgoh9k3XinN0blEEqMuOWuvwXxJifP3GJs-GczgBU,5530
|
|
20
20
|
rasa/builder/training_service.py,sha256=B5miGx0rcDWFVfS_SWmrpMQBJ9fYov0BBbckznstQvM,3757
|
|
21
21
|
rasa/builder/validation_service.py,sha256=1QWGROFyblTPznYwjMnA-nRABDb8UQpDywZ11MHBThI,2292
|
|
@@ -470,7 +470,7 @@ rasa/core/channels/rest.py,sha256=LWBYBdVzOz5Vv5tZCkB1QA7LxXJFTeC87CQLAi_ZGeI,73
|
|
|
470
470
|
rasa/core/channels/rocketchat.py,sha256=hajaH6549CjEYFM5jSapw1DQKBPKTXbn7cVSuZzknmI,5999
|
|
471
471
|
rasa/core/channels/slack.py,sha256=jVsTTUu9wUjukPoIsAhbee9o0QFUMCNlQHbR8LTcMBc,24406
|
|
472
472
|
rasa/core/channels/socketio.py,sha256=ZEavmx2on9AH73cuIFSGMKn1LHJhzcQVaqrFz7SH-CE,11348
|
|
473
|
-
rasa/core/channels/studio_chat.py,sha256
|
|
473
|
+
rasa/core/channels/studio_chat.py,sha256=MGwvZ-CmtJD6OrDtmLmFs4au1rys3J3Dv_jYqJEie30,20073
|
|
474
474
|
rasa/core/channels/telegram.py,sha256=TKVknsk3U9tYeY1a8bzlhqkltWmZfGSOvrcmwa9qozc,12499
|
|
475
475
|
rasa/core/channels/twilio.py,sha256=2BTQpyx0b0yPpc0A2BHYfxLPgodrLGLs8nq6i3lVGAM,5906
|
|
476
476
|
rasa/core/channels/vier_cvg.py,sha256=5O4yx0TDQIMppvlCxTOzmPB60CA-vqQXqWQ7upfrTO0,13496
|
|
@@ -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=
|
|
1068
|
-
rasa_pro-3.13.
|
|
1069
|
-
rasa_pro-3.13.
|
|
1070
|
-
rasa_pro-3.13.
|
|
1071
|
-
rasa_pro-3.13.
|
|
1072
|
-
rasa_pro-3.13.
|
|
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,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|