rasa-pro 3.13.1a11__py3-none-any.whl → 3.13.1a13__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/service.py +186 -124
- rasa/cli/scaffold.py +2 -0
- rasa/version.py +1 -1
- {rasa_pro-3.13.1a11.dist-info → rasa_pro-3.13.1a13.dist-info}/METADATA +1 -1
- {rasa_pro-3.13.1a11.dist-info → rasa_pro-3.13.1a13.dist-info}/RECORD +8 -8
- {rasa_pro-3.13.1a11.dist-info → rasa_pro-3.13.1a13.dist-info}/NOTICE +0 -0
- {rasa_pro-3.13.1a11.dist-info → rasa_pro-3.13.1a13.dist-info}/WHEEL +0 -0
- {rasa_pro-3.13.1a11.dist-info → rasa_pro-3.13.1a13.dist-info}/entry_points.txt +0 -0
rasa/builder/service.py
CHANGED
|
@@ -122,183 +122,245 @@ class BotBuilderService:
|
|
|
122
122
|
"""Health check endpoint."""
|
|
123
123
|
return response.json({"status": "ok", "service": "bot-builder"})
|
|
124
124
|
|
|
125
|
-
async def handle_prompt_to_bot(self, request: Request) ->
|
|
125
|
+
async def handle_prompt_to_bot(self, request: Request) -> None:
|
|
126
126
|
"""Handle prompt-to-bot generation requests."""
|
|
127
|
+
sse_response = await request.respond(content_type="text/event-stream")
|
|
128
|
+
|
|
127
129
|
try:
|
|
130
|
+
# 1. Received
|
|
131
|
+
await self._send_sse_event(
|
|
132
|
+
sse_response,
|
|
133
|
+
ServerSentEvent(event="received", data={"status": "received"}),
|
|
134
|
+
)
|
|
135
|
+
|
|
128
136
|
# Validate request
|
|
129
137
|
prompt_data = PromptRequest(**request.json)
|
|
130
138
|
|
|
131
|
-
#
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
139
|
+
# 2. Generating
|
|
140
|
+
await self._send_sse_event(
|
|
141
|
+
sse_response,
|
|
142
|
+
ServerSentEvent(event="generating", data={"status": "generating"}),
|
|
135
143
|
)
|
|
136
144
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
145
|
+
try:
|
|
146
|
+
# Generate project with retries
|
|
147
|
+
bot_files = await self.project_generator.generate_project_with_retries(
|
|
148
|
+
prompt_data.prompt,
|
|
149
|
+
template=ProjectTemplateName.PLAIN,
|
|
150
|
+
)
|
|
140
151
|
|
|
141
|
-
|
|
142
|
-
|
|
152
|
+
await self._send_sse_event(
|
|
153
|
+
sse_response,
|
|
154
|
+
ServerSentEvent(
|
|
155
|
+
event="generation_success",
|
|
156
|
+
data={"status": "generation_success"},
|
|
157
|
+
),
|
|
158
|
+
)
|
|
143
159
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
160
|
+
except (ProjectGenerationError, LLMGenerationError) as e:
|
|
161
|
+
await self._send_sse_event(
|
|
162
|
+
sse_response,
|
|
163
|
+
ServerSentEvent(
|
|
164
|
+
event="generation_error",
|
|
165
|
+
data={"status": "generation_error", "error": str(e)},
|
|
166
|
+
),
|
|
167
|
+
)
|
|
168
|
+
await sse_response.eof()
|
|
169
|
+
return
|
|
149
170
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
data={"bot_data": bot_files},
|
|
155
|
-
).model_dump()
|
|
171
|
+
# 3. Training
|
|
172
|
+
await self._send_sse_event(
|
|
173
|
+
sse_response,
|
|
174
|
+
ServerSentEvent(event="training", data={"status": "training"}),
|
|
156
175
|
)
|
|
157
176
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
return response.json(
|
|
163
|
-
ApiErrorResponse(
|
|
164
|
-
error="Validation failed", details={"validation_error": str(e)}
|
|
165
|
-
).model_dump(),
|
|
166
|
-
status=400,
|
|
167
|
-
)
|
|
177
|
+
try:
|
|
178
|
+
# Train and load agent
|
|
179
|
+
importer = self.project_generator._create_importer()
|
|
180
|
+
self.app.ctx.agent = await train_and_load_agent(importer)
|
|
168
181
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
"bot_builder_service.prompt_to_bot.generation_error", error=str(e)
|
|
172
|
-
)
|
|
173
|
-
return response.json(
|
|
174
|
-
ApiErrorResponse(
|
|
175
|
-
error="Project generation failed",
|
|
176
|
-
details={"attempts": e.attempts, "error": str(e)},
|
|
177
|
-
).model_dump(),
|
|
178
|
-
status=500,
|
|
179
|
-
)
|
|
182
|
+
# Update input channel with new agent
|
|
183
|
+
self.input_channel.agent = self.app.ctx.agent
|
|
180
184
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
185
|
+
await self._send_sse_event(
|
|
186
|
+
sse_response,
|
|
187
|
+
ServerSentEvent(
|
|
188
|
+
event="train_success", data={"status": "train_success"}
|
|
189
|
+
),
|
|
190
|
+
)
|
|
191
|
+
|
|
192
|
+
except TrainingError as e:
|
|
193
|
+
await self._send_sse_event(
|
|
194
|
+
sse_response,
|
|
195
|
+
ServerSentEvent(
|
|
196
|
+
event="train_error",
|
|
197
|
+
data={"status": "train_error", "error": str(e)},
|
|
198
|
+
),
|
|
199
|
+
)
|
|
200
|
+
await sse_response.eof()
|
|
201
|
+
return
|
|
202
|
+
|
|
203
|
+
# 4. Done
|
|
204
|
+
await self._send_sse_event(
|
|
205
|
+
sse_response,
|
|
206
|
+
ServerSentEvent(
|
|
207
|
+
event="done",
|
|
208
|
+
data={
|
|
209
|
+
"status": "done",
|
|
210
|
+
},
|
|
211
|
+
),
|
|
184
212
|
)
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
213
|
+
|
|
214
|
+
structlogger.info(
|
|
215
|
+
"bot_builder_service.prompt_to_bot.success",
|
|
216
|
+
client_id=prompt_data.client_id,
|
|
217
|
+
files_generated=list(bot_files.keys()),
|
|
190
218
|
)
|
|
191
219
|
|
|
192
|
-
except
|
|
220
|
+
except ValidationError as e:
|
|
193
221
|
structlogger.error(
|
|
194
|
-
"bot_builder_service.prompt_to_bot.
|
|
222
|
+
"bot_builder_service.prompt_to_bot.validation_error", error=str(e)
|
|
195
223
|
)
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
224
|
+
await self._send_sse_event(
|
|
225
|
+
sse_response,
|
|
226
|
+
ServerSentEvent(
|
|
227
|
+
event="validation_error",
|
|
228
|
+
data={"status": "validation_error", "error": str(e)},
|
|
229
|
+
),
|
|
201
230
|
)
|
|
202
231
|
|
|
203
232
|
except Exception as e:
|
|
204
233
|
structlogger.error(
|
|
205
234
|
"bot_builder_service.prompt_to_bot.unexpected_error", error=str(e)
|
|
206
235
|
)
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
236
|
+
await self._send_sse_event(
|
|
237
|
+
sse_response,
|
|
238
|
+
ServerSentEvent(
|
|
239
|
+
event="error", data={"status": "error", "error": str(e)}
|
|
240
|
+
),
|
|
212
241
|
)
|
|
242
|
+
finally:
|
|
243
|
+
await sse_response.eof()
|
|
213
244
|
|
|
214
|
-
async def handle_template_to_bot(self, request: Request) ->
|
|
245
|
+
async def handle_template_to_bot(self, request: Request) -> None:
|
|
215
246
|
"""Handle template-to-bot generation requests."""
|
|
247
|
+
sse_response = await request.respond(content_type="text/event-stream")
|
|
248
|
+
|
|
216
249
|
try:
|
|
250
|
+
# 1. Received
|
|
251
|
+
await self._send_sse_event(
|
|
252
|
+
sse_response,
|
|
253
|
+
ServerSentEvent(event="received", data={"status": "received"}),
|
|
254
|
+
)
|
|
255
|
+
|
|
217
256
|
# Validate request
|
|
218
257
|
template_data = TemplateRequest(**request.json)
|
|
219
258
|
|
|
220
|
-
#
|
|
221
|
-
self.
|
|
222
|
-
|
|
259
|
+
# 2. Generating
|
|
260
|
+
await self._send_sse_event(
|
|
261
|
+
sse_response,
|
|
262
|
+
ServerSentEvent(event="generating", data={"status": "generating"}),
|
|
223
263
|
)
|
|
224
|
-
bot_files = self.project_generator.get_bot_files()
|
|
225
264
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
265
|
+
try:
|
|
266
|
+
# Generate project with retries
|
|
267
|
+
self.project_generator.init_from_template(
|
|
268
|
+
template_data.template_name,
|
|
269
|
+
)
|
|
270
|
+
bot_files = self.project_generator.get_bot_files()
|
|
229
271
|
|
|
230
|
-
|
|
231
|
-
|
|
272
|
+
await self._send_sse_event(
|
|
273
|
+
sse_response,
|
|
274
|
+
ServerSentEvent(
|
|
275
|
+
event="generation_success",
|
|
276
|
+
data={"status": "generation_success"},
|
|
277
|
+
),
|
|
278
|
+
)
|
|
232
279
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
280
|
+
except ProjectGenerationError as e:
|
|
281
|
+
await self._send_sse_event(
|
|
282
|
+
sse_response,
|
|
283
|
+
ServerSentEvent(
|
|
284
|
+
event="generation_error",
|
|
285
|
+
data={"status": "generation_error", "error": str(e)},
|
|
286
|
+
),
|
|
287
|
+
)
|
|
288
|
+
await sse_response.eof()
|
|
289
|
+
return
|
|
238
290
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
data={"bot_data": bot_files},
|
|
244
|
-
).model_dump()
|
|
291
|
+
# 3. Training
|
|
292
|
+
await self._send_sse_event(
|
|
293
|
+
sse_response,
|
|
294
|
+
ServerSentEvent(event="training", data={"status": "training"}),
|
|
245
295
|
)
|
|
246
296
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
return response.json(
|
|
252
|
-
ApiErrorResponse(
|
|
253
|
-
error="Validation failed", details={"validation_error": str(e)}
|
|
254
|
-
).model_dump(),
|
|
255
|
-
status=400,
|
|
256
|
-
)
|
|
297
|
+
try:
|
|
298
|
+
# Train and load agent
|
|
299
|
+
importer = self.project_generator._create_importer()
|
|
300
|
+
self.app.ctx.agent = await train_and_load_agent(importer)
|
|
257
301
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
"bot_builder_service.template_to_bot.generation_error", error=str(e)
|
|
261
|
-
)
|
|
262
|
-
return response.json(
|
|
263
|
-
ApiErrorResponse(
|
|
264
|
-
error="Project generation failed",
|
|
265
|
-
details={"attempts": e.attempts, "error": str(e)},
|
|
266
|
-
).model_dump(),
|
|
267
|
-
status=500,
|
|
268
|
-
)
|
|
302
|
+
# Update input channel with new agent
|
|
303
|
+
self.input_channel.agent = self.app.ctx.agent
|
|
269
304
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
305
|
+
await self._send_sse_event(
|
|
306
|
+
sse_response,
|
|
307
|
+
ServerSentEvent(
|
|
308
|
+
event="train_success", data={"status": "train_success"}
|
|
309
|
+
),
|
|
310
|
+
)
|
|
311
|
+
|
|
312
|
+
except TrainingError as e:
|
|
313
|
+
await self._send_sse_event(
|
|
314
|
+
sse_response,
|
|
315
|
+
ServerSentEvent(
|
|
316
|
+
event="train_error",
|
|
317
|
+
data={"status": "train_error", "error": str(e)},
|
|
318
|
+
),
|
|
319
|
+
)
|
|
320
|
+
await sse_response.eof()
|
|
321
|
+
return
|
|
322
|
+
|
|
323
|
+
# 4. Done
|
|
324
|
+
await self._send_sse_event(
|
|
325
|
+
sse_response,
|
|
326
|
+
ServerSentEvent(
|
|
327
|
+
event="done",
|
|
328
|
+
data={
|
|
329
|
+
"status": "done",
|
|
330
|
+
},
|
|
331
|
+
),
|
|
273
332
|
)
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
333
|
+
|
|
334
|
+
structlogger.info(
|
|
335
|
+
"bot_builder_service.template_to_bot.success",
|
|
336
|
+
client_id=template_data.client_id,
|
|
337
|
+
files_generated=list(bot_files.keys()),
|
|
279
338
|
)
|
|
280
339
|
|
|
281
|
-
except
|
|
340
|
+
except ValidationError as e:
|
|
282
341
|
structlogger.error(
|
|
283
|
-
"bot_builder_service.template_to_bot.
|
|
342
|
+
"bot_builder_service.template_to_bot.validation_error", error=str(e)
|
|
284
343
|
)
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
344
|
+
await self._send_sse_event(
|
|
345
|
+
sse_response,
|
|
346
|
+
ServerSentEvent(
|
|
347
|
+
event="validation_error",
|
|
348
|
+
data={"status": "validation_error", "error": str(e)},
|
|
349
|
+
),
|
|
290
350
|
)
|
|
291
351
|
|
|
292
352
|
except Exception as e:
|
|
293
353
|
structlogger.error(
|
|
294
354
|
"bot_builder_service.template_to_bot.unexpected_error", error=str(e)
|
|
295
355
|
)
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
356
|
+
await self._send_sse_event(
|
|
357
|
+
sse_response,
|
|
358
|
+
ServerSentEvent(
|
|
359
|
+
event="error", data={"status": "error", "error": str(e)}
|
|
360
|
+
),
|
|
301
361
|
)
|
|
362
|
+
finally:
|
|
363
|
+
await sse_response.eof()
|
|
302
364
|
|
|
303
365
|
async def get_bot_data(self, request: Request) -> HTTPResponse:
|
|
304
366
|
"""Get current bot data."""
|
rasa/cli/scaffold.py
CHANGED
|
@@ -178,6 +178,8 @@ def create_initial_project(
|
|
|
178
178
|
# https://stackoverflow.com/questions/9160227/dir-util-copy-tree-fails-after-shutil-rmtree
|
|
179
179
|
if hasattr(dir_util, "_path_created"):
|
|
180
180
|
dir_util._path_created.clear()
|
|
181
|
+
else:
|
|
182
|
+
dir_util.SkipRepeatAbsolutePaths.clear()
|
|
181
183
|
dir_util.copy_tree(scaffold_path(template), path)
|
|
182
184
|
|
|
183
185
|
|
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.1a13
|
|
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
|
|
@@ -15,7 +15,7 @@ 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=
|
|
18
|
+
rasa/builder/service.py,sha256=uuiBjyMp1iRsGexL-xJP9vfRxmRjJPKruOC5oMxIXd8,19158
|
|
19
19
|
rasa/builder/skill_to_bot_prompt.jinja2,sha256=h2Fgoh9k3XinN0blEEqMuOWuvwXxJifP3GJs-GczgBU,5530
|
|
20
20
|
rasa/builder/training_service.py,sha256=YSVaf6x9WuddrOruJ5BmacnRoypQVVuKZbvZq_c6xEE,3849
|
|
21
21
|
rasa/builder/validation_service.py,sha256=rKMgbG8Jyv8WMnTIXOMd7VuGWAYicrL9wDJ22BJXZHE,2765
|
|
@@ -277,7 +277,7 @@ rasa/cli/project_templates/tutorial/data/patterns.yml,sha256=phj1vrOcAacwzdVHFHN
|
|
|
277
277
|
rasa/cli/project_templates/tutorial/domain.yml,sha256=X16UwfoTNKSV2DYvEQZ-CfRczzg5MqI49AHgSH0-aZs,974
|
|
278
278
|
rasa/cli/project_templates/tutorial/endpoints.yml,sha256=ZZfchpZLo5MObU5JVXPqBi8KrKe8gzsZskSDAjpfS9E,1788
|
|
279
279
|
rasa/cli/run.py,sha256=QnmVCXORZambJzee1z3wMa3Ki8cPwSsImgQ2hbvbpuU,4632
|
|
280
|
-
rasa/cli/scaffold.py,sha256=
|
|
280
|
+
rasa/cli/scaffold.py,sha256=_r6LlS4XQ_vZjcEzkP90V1KGrDaPFVflzhMIKGoVGGM,8726
|
|
281
281
|
rasa/cli/shell.py,sha256=YTXn3_iDWJySY187BEJTRDxPoG-mqRtl17jqwqQ6hX4,4332
|
|
282
282
|
rasa/cli/studio/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
283
283
|
rasa/cli/studio/download.py,sha256=5uLdnW60JQ1NkUcJfK_be2pKjVOtYzCCjNAQpfGkYnM,1163
|
|
@@ -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=aL2g7nBrRREeKnF27m5SgpCh9ZDstkP_1-sfxmja27g,120
|
|
1068
|
+
rasa_pro-3.13.1a13.dist-info/METADATA,sha256=Lr956qzv6dpZ1w-YmuP7DFm3yBGxcCbx56YANsNHISI,10556
|
|
1069
|
+
rasa_pro-3.13.1a13.dist-info/NOTICE,sha256=7HlBoMHJY9CL2GlYSfTQ-PZsVmLmVkYmMiPlTjhuCqA,218
|
|
1070
|
+
rasa_pro-3.13.1a13.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
|
1071
|
+
rasa_pro-3.13.1a13.dist-info/entry_points.txt,sha256=ckJ2SfEyTPgBqj_I6vm_tqY9dZF_LAPJZA335Xp0Q9U,43
|
|
1072
|
+
rasa_pro-3.13.1a13.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|