rasa-pro 3.13.1a11__py3-none-any.whl → 3.13.1a12__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 +188 -124
- rasa/cli/scaffold.py +2 -0
- rasa/version.py +1 -1
- {rasa_pro-3.13.1a11.dist-info → rasa_pro-3.13.1a12.dist-info}/METADATA +1 -1
- {rasa_pro-3.13.1a11.dist-info → rasa_pro-3.13.1a12.dist-info}/RECORD +8 -8
- {rasa_pro-3.13.1a11.dist-info → rasa_pro-3.13.1a12.dist-info}/NOTICE +0 -0
- {rasa_pro-3.13.1a11.dist-info → rasa_pro-3.13.1a12.dist-info}/WHEEL +0 -0
- {rasa_pro-3.13.1a11.dist-info → rasa_pro-3.13.1a12.dist-info}/entry_points.txt +0 -0
rasa/builder/service.py
CHANGED
|
@@ -122,183 +122,247 @@ 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
|
+
"bot_data": bot_files,
|
|
211
|
+
},
|
|
212
|
+
),
|
|
184
213
|
)
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
214
|
+
|
|
215
|
+
structlogger.info(
|
|
216
|
+
"bot_builder_service.prompt_to_bot.success",
|
|
217
|
+
client_id=prompt_data.client_id,
|
|
218
|
+
files_generated=list(bot_files.keys()),
|
|
190
219
|
)
|
|
191
220
|
|
|
192
|
-
except
|
|
221
|
+
except ValidationError as e:
|
|
193
222
|
structlogger.error(
|
|
194
|
-
"bot_builder_service.prompt_to_bot.
|
|
223
|
+
"bot_builder_service.prompt_to_bot.validation_error", error=str(e)
|
|
195
224
|
)
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
225
|
+
await self._send_sse_event(
|
|
226
|
+
sse_response,
|
|
227
|
+
ServerSentEvent(
|
|
228
|
+
event="validation_error",
|
|
229
|
+
data={"status": "validation_error", "error": str(e)},
|
|
230
|
+
),
|
|
201
231
|
)
|
|
202
232
|
|
|
203
233
|
except Exception as e:
|
|
204
234
|
structlogger.error(
|
|
205
235
|
"bot_builder_service.prompt_to_bot.unexpected_error", error=str(e)
|
|
206
236
|
)
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
237
|
+
await self._send_sse_event(
|
|
238
|
+
sse_response,
|
|
239
|
+
ServerSentEvent(
|
|
240
|
+
event="error", data={"status": "error", "error": str(e)}
|
|
241
|
+
),
|
|
212
242
|
)
|
|
243
|
+
finally:
|
|
244
|
+
await sse_response.eof()
|
|
213
245
|
|
|
214
|
-
async def handle_template_to_bot(self, request: Request) ->
|
|
246
|
+
async def handle_template_to_bot(self, request: Request) -> None:
|
|
215
247
|
"""Handle template-to-bot generation requests."""
|
|
248
|
+
sse_response = await request.respond(content_type="text/event-stream")
|
|
249
|
+
|
|
216
250
|
try:
|
|
251
|
+
# 1. Received
|
|
252
|
+
await self._send_sse_event(
|
|
253
|
+
sse_response,
|
|
254
|
+
ServerSentEvent(event="received", data={"status": "received"}),
|
|
255
|
+
)
|
|
256
|
+
|
|
217
257
|
# Validate request
|
|
218
258
|
template_data = TemplateRequest(**request.json)
|
|
219
259
|
|
|
220
|
-
#
|
|
221
|
-
self.
|
|
222
|
-
|
|
260
|
+
# 2. Generating
|
|
261
|
+
await self._send_sse_event(
|
|
262
|
+
sse_response,
|
|
263
|
+
ServerSentEvent(event="generating", data={"status": "generating"}),
|
|
223
264
|
)
|
|
224
|
-
bot_files = self.project_generator.get_bot_files()
|
|
225
265
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
266
|
+
try:
|
|
267
|
+
# Generate project with retries
|
|
268
|
+
self.project_generator.init_from_template(
|
|
269
|
+
template_data.template_name,
|
|
270
|
+
)
|
|
271
|
+
bot_files = self.project_generator.get_bot_files()
|
|
229
272
|
|
|
230
|
-
|
|
231
|
-
|
|
273
|
+
await self._send_sse_event(
|
|
274
|
+
sse_response,
|
|
275
|
+
ServerSentEvent(
|
|
276
|
+
event="generation_success",
|
|
277
|
+
data={"status": "generation_success"},
|
|
278
|
+
),
|
|
279
|
+
)
|
|
232
280
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
281
|
+
except ProjectGenerationError as e:
|
|
282
|
+
await self._send_sse_event(
|
|
283
|
+
sse_response,
|
|
284
|
+
ServerSentEvent(
|
|
285
|
+
event="generation_error",
|
|
286
|
+
data={"status": "generation_error", "error": str(e)},
|
|
287
|
+
),
|
|
288
|
+
)
|
|
289
|
+
await sse_response.eof()
|
|
290
|
+
return
|
|
238
291
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
data={"bot_data": bot_files},
|
|
244
|
-
).model_dump()
|
|
292
|
+
# 3. Training
|
|
293
|
+
await self._send_sse_event(
|
|
294
|
+
sse_response,
|
|
295
|
+
ServerSentEvent(event="training", data={"status": "training"}),
|
|
245
296
|
)
|
|
246
297
|
|
|
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
|
-
)
|
|
298
|
+
try:
|
|
299
|
+
# Train and load agent
|
|
300
|
+
importer = self.project_generator._create_importer()
|
|
301
|
+
self.app.ctx.agent = await train_and_load_agent(importer)
|
|
257
302
|
|
|
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
|
-
)
|
|
303
|
+
# Update input channel with new agent
|
|
304
|
+
self.input_channel.agent = self.app.ctx.agent
|
|
269
305
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
306
|
+
await self._send_sse_event(
|
|
307
|
+
sse_response,
|
|
308
|
+
ServerSentEvent(
|
|
309
|
+
event="train_success", data={"status": "train_success"}
|
|
310
|
+
),
|
|
311
|
+
)
|
|
312
|
+
|
|
313
|
+
except TrainingError as e:
|
|
314
|
+
await self._send_sse_event(
|
|
315
|
+
sse_response,
|
|
316
|
+
ServerSentEvent(
|
|
317
|
+
event="train_error",
|
|
318
|
+
data={"status": "train_error", "error": str(e)},
|
|
319
|
+
),
|
|
320
|
+
)
|
|
321
|
+
await sse_response.eof()
|
|
322
|
+
return
|
|
323
|
+
|
|
324
|
+
# 4. Done
|
|
325
|
+
await self._send_sse_event(
|
|
326
|
+
sse_response,
|
|
327
|
+
ServerSentEvent(
|
|
328
|
+
event="done",
|
|
329
|
+
data={
|
|
330
|
+
"status": "done",
|
|
331
|
+
"bot_data": bot_files,
|
|
332
|
+
},
|
|
333
|
+
),
|
|
273
334
|
)
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
335
|
+
|
|
336
|
+
structlogger.info(
|
|
337
|
+
"bot_builder_service.template_to_bot.success",
|
|
338
|
+
client_id=template_data.client_id,
|
|
339
|
+
files_generated=list(bot_files.keys()),
|
|
279
340
|
)
|
|
280
341
|
|
|
281
|
-
except
|
|
342
|
+
except ValidationError as e:
|
|
282
343
|
structlogger.error(
|
|
283
|
-
"bot_builder_service.template_to_bot.
|
|
344
|
+
"bot_builder_service.template_to_bot.validation_error", error=str(e)
|
|
284
345
|
)
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
346
|
+
await self._send_sse_event(
|
|
347
|
+
sse_response,
|
|
348
|
+
ServerSentEvent(
|
|
349
|
+
event="validation_error",
|
|
350
|
+
data={"status": "validation_error", "error": str(e)},
|
|
351
|
+
),
|
|
290
352
|
)
|
|
291
353
|
|
|
292
354
|
except Exception as e:
|
|
293
355
|
structlogger.error(
|
|
294
356
|
"bot_builder_service.template_to_bot.unexpected_error", error=str(e)
|
|
295
357
|
)
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
358
|
+
await self._send_sse_event(
|
|
359
|
+
sse_response,
|
|
360
|
+
ServerSentEvent(
|
|
361
|
+
event="error", data={"status": "error", "error": str(e)}
|
|
362
|
+
),
|
|
301
363
|
)
|
|
364
|
+
finally:
|
|
365
|
+
await sse_response.eof()
|
|
302
366
|
|
|
303
367
|
async def get_bot_data(self, request: Request) -> HTTPResponse:
|
|
304
368
|
"""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.1a12
|
|
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=YpVhK8HQxK9l8MFf70hK9U5cYp8GGMYvvLr4Lq0Co8I,19252
|
|
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=EOvwRH_ZdAavpBA4bcQ7NwBtPoPX4LPPjQhA6ru8y8Y,120
|
|
1068
|
+
rasa_pro-3.13.1a12.dist-info/METADATA,sha256=KkHYzwkHiQwJnCHPOw_BJCS86TogyDwj03j6sJqXn4c,10556
|
|
1069
|
+
rasa_pro-3.13.1a12.dist-info/NOTICE,sha256=7HlBoMHJY9CL2GlYSfTQ-PZsVmLmVkYmMiPlTjhuCqA,218
|
|
1070
|
+
rasa_pro-3.13.1a12.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
|
1071
|
+
rasa_pro-3.13.1a12.dist-info/entry_points.txt,sha256=ckJ2SfEyTPgBqj_I6vm_tqY9dZF_LAPJZA335Xp0Q9U,43
|
|
1072
|
+
rasa_pro-3.13.1a12.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|