rasa-pro 3.13.1a10__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 +1 -1
- rasa/builder/main.py +4 -4
- rasa/builder/service.py +48 -20
- rasa/version.py +1 -1
- {rasa_pro-3.13.1a10.dist-info → rasa_pro-3.13.1a11.dist-info}/METADATA +1 -1
- {rasa_pro-3.13.1a10.dist-info → rasa_pro-3.13.1a11.dist-info}/RECORD +9 -9
- {rasa_pro-3.13.1a10.dist-info → rasa_pro-3.13.1a11.dist-info}/NOTICE +0 -0
- {rasa_pro-3.13.1a10.dist-info → rasa_pro-3.13.1a11.dist-info}/WHEEL +0 -0
- {rasa_pro-3.13.1a10.dist-info → rasa_pro-3.13.1a11.dist-info}/entry_points.txt +0 -0
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. **`
|
|
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
|
|
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 =
|
|
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
|
|
39
|
-
"""Main service for
|
|
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
|
-
"
|
|
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": "
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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",
|
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.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=
|
|
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,11 +11,11 @@ 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=
|
|
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=
|
|
18
|
+
rasa/builder/service.py,sha256=zqqB75o4pbIuSFDmjOtH2VpphV4ysrwT920eu-LC6V8,17328
|
|
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
|
|
@@ -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=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,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|