aab-prompts 1.1.6__py3-none-any.whl → 1.1.7__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.
- {aab_prompts-1.1.6.dist-info → aab_prompts-1.1.7.dist-info}/METADATA +1 -1
- {aab_prompts-1.1.6.dist-info → aab_prompts-1.1.7.dist-info}/RECORD +7 -7
- aab_service.py +99 -66
- prompts/planner.py +5 -2
- prompts/router.py +34 -42
- {aab_prompts-1.1.6.dist-info → aab_prompts-1.1.7.dist-info}/WHEEL +0 -0
- {aab_prompts-1.1.6.dist-info → aab_prompts-1.1.7.dist-info}/top_level.txt +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
aab_service.py,sha256=
|
|
1
|
+
aab_service.py,sha256=vh_tzuk45cSLo8ZCw7bvUBfLtatWi2dFjeb6C_3htx0,13660
|
|
2
2
|
prompts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
prompts/breadcrumbs.py,sha256=GrcI7w_6VbOG7vo3F5afHMJQKTpClePllEW1OMdHcps,5621
|
|
4
4
|
prompts/constants.py,sha256=3QtDlHG1jr5KRK1kfX5F_1CEtc2QEB0JWl0Cir-bbp4,53274
|
|
@@ -7,14 +7,14 @@ prompts/menu_navigations.py,sha256=otB4_pD78Y-2u4zJtBnB4_k9IE1Uf0K1Lq2YgxOe0qk,1
|
|
|
7
7
|
prompts/objects_fields.py,sha256=a--HwdoXgMdos8Sr6xHOIS_1FMeq_8tHCQacGw3lDRA,35856
|
|
8
8
|
prompts/page_planner.py,sha256=C1DXktj-O2LvJpapHgv1X2AL8zrLY5LtDaRl1fxOwX8,6686
|
|
9
9
|
prompts/pages.py,sha256=5x4bfXHutKK5TqyZkd7zaHlti-8TFKsJNnk2s7cu_NE,7143
|
|
10
|
-
prompts/planner.py,sha256=
|
|
11
|
-
prompts/router.py,sha256=
|
|
10
|
+
prompts/planner.py,sha256=GKr-_uNFG4NFYj3-4A8hi0hEolT47mkw00qUipDstYM,32736
|
|
11
|
+
prompts/router.py,sha256=0DAr4FO3_y83olZriGd6LiwS7BWO5zgewOpr7PAZYmI,12048
|
|
12
12
|
prompts/solutions_applications.py,sha256=OPscwiz_6HlT_CFZqnnNBtKDPRekDyd6mesSZf9fhkQ,6130
|
|
13
13
|
prompts/view_filter_planner.py,sha256=DtYZQ7qfFZiXMYosjSGPiPmUu8cSFYAjcAgpCbZf9LA,3466
|
|
14
14
|
prompts/view_links_planner.py,sha256=Bb7UUO15LIDmNjzkFZyzT3eAWCWnzcrm4vvyc8NsJJA,2341
|
|
15
15
|
prompts/view_planner.py,sha256=Og1bOeDqcMIGLAKzYiJAJLgPLaxQ9Wf7nydfFAzivRY,3803
|
|
16
16
|
prompts/views.py,sha256=oQIAiF8KYIbp8q8zBhwrQF4XFauBG7jkiZ9Nh4_eBf8,21638
|
|
17
|
-
aab_prompts-1.1.
|
|
18
|
-
aab_prompts-1.1.
|
|
19
|
-
aab_prompts-1.1.
|
|
20
|
-
aab_prompts-1.1.
|
|
17
|
+
aab_prompts-1.1.7.dist-info/METADATA,sha256=MHR8pD4taSBPc4XrRAHRP9UeEPhbc5jUTVVV5k1Vc2I,712
|
|
18
|
+
aab_prompts-1.1.7.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
19
|
+
aab_prompts-1.1.7.dist-info/top_level.txt,sha256=bvREqxmC7tnWTsG-q-oA5Qzkt1SLk0sK3aD5wlHjhII,20
|
|
20
|
+
aab_prompts-1.1.7.dist-info/RECORD,,
|
aab_service.py
CHANGED
|
@@ -9,22 +9,49 @@ from prompts.expressions import (
|
|
|
9
9
|
VIEW_FILTER_EXPRESSION_AGENT_PROMPT_TEMPLATE,
|
|
10
10
|
VIEWS_EXPRESSION_AGENT_PROMPT_TEMPLATE,
|
|
11
11
|
)
|
|
12
|
-
from prompts.menu_navigations import
|
|
13
|
-
|
|
12
|
+
from prompts.menu_navigations import (
|
|
13
|
+
MENU_NAVIGATIONS_AGENT_SYSTEM_PROMPT_TEMPLATE,
|
|
14
|
+
)
|
|
15
|
+
from prompts.objects_fields import (
|
|
16
|
+
OBJECTS_FIELDS_AGENT_SYSTEM_PROMPT_TEMPLATE,
|
|
17
|
+
STANDARD_OBJECTS_DESCRIPTIONS_TEMPLATE,
|
|
18
|
+
SYSTEM_OBJECTS_DESCRIPTIONS_TEMPLATE,
|
|
19
|
+
)
|
|
14
20
|
from prompts.page_planner import PAGE_PLANNER_AGENT_SYSTEM_PROMPT_TEMPLATE
|
|
15
|
-
from prompts.pages import
|
|
16
|
-
|
|
21
|
+
from prompts.pages import (
|
|
22
|
+
PAGE_DATA_BINDER_TEMPLATE,
|
|
23
|
+
PAGES_AGENT_SYSTEM_PROMPT_TEMPLATE,
|
|
24
|
+
)
|
|
25
|
+
from prompts.planner import (
|
|
26
|
+
PLANNER_AGENT_SYSTEM_PROMPT_TEMPLATE,
|
|
27
|
+
PLANNER_EXAMPLES_TEMPLATE,
|
|
28
|
+
)
|
|
17
29
|
from prompts.router import ROUTER_AGENT_SYSTEM_PROMPT_TEMPLATE
|
|
18
|
-
from prompts.solutions_applications import
|
|
30
|
+
from prompts.solutions_applications import (
|
|
31
|
+
SOLUTIONS_APPLICATIONS_AGENT_SYSTEM_PROMPT_TEMPLATE,
|
|
32
|
+
)
|
|
19
33
|
from prompts.view_filter_planner import VIEW_FILTER_PLANNER_PROMPT_TEMPLATE
|
|
20
34
|
from prompts.view_links_planner import VIEW_LINKS_PLANNER_PROMPT_TEMPLATE
|
|
21
35
|
from prompts.view_planner import VIEWS_PLANNER_AGENT_SYSTEM_PROMPT_TEMPLATE
|
|
22
|
-
from prompts.views import
|
|
36
|
+
from prompts.views import (
|
|
37
|
+
CALENDAR_VIEW_PROPERTIES_TEMPLATE,
|
|
38
|
+
CARD_VIEW_PROPERTIES_TEMPLATE,
|
|
39
|
+
COMMON_VIEW_PROPERTIES_TEMPLATE,
|
|
40
|
+
CREATE_VIEW_PROPERTIES_TEMPLATE,
|
|
41
|
+
DECK_VIEW_PROPERTIES_TEMPLATE,
|
|
42
|
+
DETAIL_VIEW_PROPERTIES_TEMPLATE,
|
|
43
|
+
LIST_VIEW_PROPERTIES_TEMPLATE,
|
|
44
|
+
MAP_VIEW_PROPERTIES_TEMPLATE,
|
|
45
|
+
VIEW_FILTERS_PROPERTIES_TEMPLATE,
|
|
46
|
+
VIEW_LINKS_PROPERTIES_TEMPLATE,
|
|
47
|
+
VIEW_TYPE_DETAILS_TEMPLATE,
|
|
48
|
+
VIEWS_AGENT_SYSTEM_PROMPT_TEMPLATE,
|
|
49
|
+
)
|
|
23
50
|
|
|
24
51
|
|
|
25
52
|
class _BreadcrumbsHandler:
|
|
26
53
|
"""Handler for all breadcrumb-related prompts."""
|
|
27
|
-
|
|
54
|
+
|
|
28
55
|
@property
|
|
29
56
|
def BREADCRUMB_AGENT_SYSTEM_PROMPT(self) -> str:
|
|
30
57
|
return BREADCRUMB_AGENT_SYSTEM_PROMPT_TEMPLATE
|
|
@@ -32,10 +59,10 @@ class _BreadcrumbsHandler:
|
|
|
32
59
|
|
|
33
60
|
class _ExpressionsHandler:
|
|
34
61
|
"""Handler for all expression-related prompts."""
|
|
35
|
-
|
|
62
|
+
|
|
36
63
|
def __init__(self, core_expressions: dict) -> None:
|
|
37
64
|
self.core_expressions = core_expressions
|
|
38
|
-
|
|
65
|
+
|
|
39
66
|
def _generate_system_prompt(self, expressions: dict) -> str:
|
|
40
67
|
sections: list[str] = []
|
|
41
68
|
|
|
@@ -48,13 +75,16 @@ class _ExpressionsHandler:
|
|
|
48
75
|
|
|
49
76
|
example_lines = (
|
|
50
77
|
"\n".join(
|
|
51
|
-
f"- {ex.get('syntax')} → {ex.get('returns')}"
|
|
78
|
+
f"- {ex.get('syntax')} → {ex.get('returns')}"
|
|
79
|
+
for ex in examples
|
|
52
80
|
)
|
|
53
81
|
or "None"
|
|
54
82
|
)
|
|
55
83
|
|
|
56
84
|
alias_lines = (
|
|
57
|
-
"\n".join(f"- {alias}" for alias in aliases)
|
|
85
|
+
"\n".join(f"- {alias}" for alias in aliases)
|
|
86
|
+
if aliases
|
|
87
|
+
else "None"
|
|
58
88
|
)
|
|
59
89
|
|
|
60
90
|
sections.append(
|
|
@@ -88,29 +118,29 @@ class _ExpressionsHandler:
|
|
|
88
118
|
|
|
89
119
|
{self._generate_system_prompt(self.core_expressions)}
|
|
90
120
|
"""
|
|
91
|
-
|
|
121
|
+
|
|
92
122
|
@property
|
|
93
123
|
def EXPRESSION_REQUIREMENTS(self) -> str:
|
|
94
124
|
return EXPRESSION_REQUIREMENTS_TEMPLATE
|
|
95
|
-
|
|
125
|
+
|
|
96
126
|
@property
|
|
97
127
|
def EXPRESSIONS_AGENT_PROMPT(self) -> str:
|
|
98
128
|
return EXPRESSIONS_AGENT_PROMPT_TEMPLATE.format(
|
|
99
129
|
EXPRESSION_REQUIREMENTS=self.EXPRESSION_REQUIREMENTS,
|
|
100
130
|
CORE_EXPRESSIONS=self.CORE_EXPRESSIONS,
|
|
101
131
|
)
|
|
102
|
-
|
|
132
|
+
|
|
103
133
|
@property
|
|
104
134
|
def SHOW_IF_EXPRESSION_AGENT_PROMPT(self) -> str:
|
|
105
135
|
return SHOW_IF_EXPRESSION_AGENT_PROMPT_TEMPLATE.format(
|
|
106
136
|
EXPRESSION_REQUIREMENTS=self.EXPRESSION_REQUIREMENTS,
|
|
107
137
|
CORE_EXPRESSIONS=self.CORE_EXPRESSIONS,
|
|
108
138
|
)
|
|
109
|
-
|
|
139
|
+
|
|
110
140
|
@property
|
|
111
141
|
def INITIAL_VALUE_EXAMPLES(self) -> str:
|
|
112
142
|
return INITIAL_VALUE_EXAMPLES_TEMPLATE
|
|
113
|
-
|
|
143
|
+
|
|
114
144
|
@property
|
|
115
145
|
def VIEW_FILTER_EXPRESSION_AGENT_PROMPT(self) -> str:
|
|
116
146
|
return VIEW_FILTER_EXPRESSION_AGENT_PROMPT_TEMPLATE.format(
|
|
@@ -124,14 +154,14 @@ class _ExpressionsHandler:
|
|
|
124
154
|
EXPRESSION_REQUIREMENTS=self.EXPRESSION_REQUIREMENTS,
|
|
125
155
|
CORE_EXPRESSIONS=self.CORE_EXPRESSIONS,
|
|
126
156
|
)
|
|
127
|
-
|
|
157
|
+
|
|
128
158
|
@property
|
|
129
159
|
def VIEWS_EXPRESSION_AGENT_PROMPT(self) -> str:
|
|
130
160
|
return VIEWS_EXPRESSION_AGENT_PROMPT_TEMPLATE.format(
|
|
131
161
|
EXPRESSION_REQUIREMENTS=self.EXPRESSION_REQUIREMENTS,
|
|
132
162
|
CORE_EXPRESSIONS=self.CORE_EXPRESSIONS,
|
|
133
163
|
)
|
|
134
|
-
|
|
164
|
+
|
|
135
165
|
@property
|
|
136
166
|
def PAGE_DATA_BINDER_AGENT_PROMPT(self) -> str:
|
|
137
167
|
return PAGE_DATA_BINDER_AGENT_PROMPT_TEMPLATE.format(
|
|
@@ -139,9 +169,10 @@ class _ExpressionsHandler:
|
|
|
139
169
|
CORE_EXPRESSIONS=self.CORE_EXPRESSIONS,
|
|
140
170
|
)
|
|
141
171
|
|
|
172
|
+
|
|
142
173
|
class _MenuNavigationsHandler:
|
|
143
174
|
"""Handler for all menu navigation-related prompts."""
|
|
144
|
-
|
|
175
|
+
|
|
145
176
|
@property
|
|
146
177
|
def MENU_NAVIGATIONS_AGENT_SYSTEM_PROMPT(self) -> str:
|
|
147
178
|
return MENU_NAVIGATIONS_AGENT_SYSTEM_PROMPT_TEMPLATE
|
|
@@ -149,14 +180,14 @@ class _MenuNavigationsHandler:
|
|
|
149
180
|
|
|
150
181
|
class _ObjectsFieldsHandler:
|
|
151
182
|
"""Handler for all object and field-related prompts."""
|
|
152
|
-
|
|
183
|
+
|
|
153
184
|
def __init__(self, restricted_objects_list: list[str]) -> None:
|
|
154
185
|
self.restricted_objects_list = restricted_objects_list
|
|
155
|
-
|
|
186
|
+
|
|
156
187
|
@property
|
|
157
188
|
def STANDARD_OBJECTS_DESCRIPTIONS(self) -> str:
|
|
158
189
|
return STANDARD_OBJECTS_DESCRIPTIONS_TEMPLATE
|
|
159
|
-
|
|
190
|
+
|
|
160
191
|
@property
|
|
161
192
|
def SYSTEM_OBJECTS_DESCRIPTIONS(self) -> str:
|
|
162
193
|
return SYSTEM_OBJECTS_DESCRIPTIONS_TEMPLATE
|
|
@@ -170,7 +201,7 @@ class _ObjectsFieldsHandler:
|
|
|
170
201
|
|
|
171
202
|
class _PagePlannerHandler:
|
|
172
203
|
"""Handler for all page planner-related prompts."""
|
|
173
|
-
|
|
204
|
+
|
|
174
205
|
@property
|
|
175
206
|
def PAGE_PLANNER_AGENT_SYSTEM_PROMPT(self) -> str:
|
|
176
207
|
return PAGE_PLANNER_AGENT_SYSTEM_PROMPT_TEMPLATE
|
|
@@ -178,11 +209,11 @@ class _PagePlannerHandler:
|
|
|
178
209
|
|
|
179
210
|
class _PagesHandler:
|
|
180
211
|
"""Handler for all page-related prompts."""
|
|
181
|
-
|
|
212
|
+
|
|
182
213
|
@property
|
|
183
214
|
def PAGES_AGENT_SYSTEM_PROMPT(self) -> str:
|
|
184
215
|
return PAGES_AGENT_SYSTEM_PROMPT_TEMPLATE
|
|
185
|
-
|
|
216
|
+
|
|
186
217
|
@property
|
|
187
218
|
def PAGE_DATA_BINDER(self) -> str:
|
|
188
219
|
return PAGE_DATA_BINDER_TEMPLATE
|
|
@@ -190,17 +221,23 @@ class _PagesHandler:
|
|
|
190
221
|
|
|
191
222
|
class _PlannerHandler:
|
|
192
223
|
"""Handler for all planner-related prompts."""
|
|
193
|
-
|
|
194
|
-
def __init__(
|
|
224
|
+
|
|
225
|
+
def __init__(
|
|
226
|
+
self,
|
|
227
|
+
restricted_objects_list: list[str],
|
|
228
|
+
standard_objects_descriptions: str,
|
|
229
|
+
system_objects_descriptions: str,
|
|
230
|
+
view_type_details_template: str,
|
|
231
|
+
) -> None:
|
|
195
232
|
self.restricted_objects_list = restricted_objects_list
|
|
196
233
|
self.standard_objects_descriptions = standard_objects_descriptions
|
|
197
234
|
self.system_objects_descriptions = system_objects_descriptions
|
|
198
235
|
self.view_type_details_template = view_type_details_template
|
|
199
|
-
|
|
236
|
+
|
|
200
237
|
@property
|
|
201
238
|
def PLANNER_EXAMPLES(self) -> str:
|
|
202
|
-
return
|
|
203
|
-
|
|
239
|
+
return "\n\n\n".join(PLANNER_EXAMPLES_TEMPLATE)
|
|
240
|
+
|
|
204
241
|
@property
|
|
205
242
|
def PLANNER_AGENT_SYSTEM_PROMPT(self) -> str:
|
|
206
243
|
return PLANNER_AGENT_SYSTEM_PROMPT_TEMPLATE.format(
|
|
@@ -214,28 +251,24 @@ class _PlannerHandler:
|
|
|
214
251
|
|
|
215
252
|
class _RouterHandler:
|
|
216
253
|
"""Handler for all router-related prompts."""
|
|
217
|
-
|
|
218
|
-
def __init__(self
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
self.planner_examples = planner_examples
|
|
222
|
-
|
|
254
|
+
|
|
255
|
+
def __init__(self) -> None:
|
|
256
|
+
pass
|
|
257
|
+
|
|
223
258
|
@property
|
|
224
259
|
def ROUTER_AGENT_SYSTEM_PROMPT(self) -> str:
|
|
225
|
-
return ROUTER_AGENT_SYSTEM_PROMPT_TEMPLATE
|
|
226
|
-
STANDARD_OBJECTS_DESCRIPTIONS=self.standard_objects_descriptions,
|
|
227
|
-
SYSTEM_OBJECTS_DESCRIPTIONS=self.system_objects_descriptions,
|
|
228
|
-
PLANNER_EXAMPLES=self.planner_examples,
|
|
229
|
-
)
|
|
260
|
+
return ROUTER_AGENT_SYSTEM_PROMPT_TEMPLATE
|
|
230
261
|
|
|
231
262
|
|
|
232
263
|
class _SolutionsApplicationsHandler:
|
|
233
264
|
"""Handler for all solutions and applications-related prompts."""
|
|
234
|
-
|
|
235
|
-
def __init__(
|
|
265
|
+
|
|
266
|
+
def __init__(
|
|
267
|
+
self, default_solution_id: str, default_application_id: str
|
|
268
|
+
) -> None:
|
|
236
269
|
self.default_solution_id = default_solution_id
|
|
237
270
|
self.default_application_id = default_application_id
|
|
238
|
-
|
|
271
|
+
|
|
239
272
|
@property
|
|
240
273
|
def SOLUTIONS_APPLICATIONS_AGENT_SYSTEM_PROMPT(self) -> str:
|
|
241
274
|
return SOLUTIONS_APPLICATIONS_AGENT_SYSTEM_PROMPT_TEMPLATE.format(
|
|
@@ -250,15 +283,15 @@ class _ViewsHandler:
|
|
|
250
283
|
@property
|
|
251
284
|
def VIEW_TYPE_DETAILS(self) -> str:
|
|
252
285
|
return VIEW_TYPE_DETAILS_TEMPLATE
|
|
253
|
-
|
|
286
|
+
|
|
254
287
|
@property
|
|
255
288
|
def COMMON_VIEW_PROPERTIES(self) -> str:
|
|
256
289
|
return COMMON_VIEW_PROPERTIES_TEMPLATE
|
|
257
|
-
|
|
290
|
+
|
|
258
291
|
@property
|
|
259
292
|
def LIST_VIEW_PROPERTIES(self) -> str:
|
|
260
293
|
return LIST_VIEW_PROPERTIES_TEMPLATE
|
|
261
|
-
|
|
294
|
+
|
|
262
295
|
@property
|
|
263
296
|
def CARD_VIEW_PROPERTIES(self) -> str:
|
|
264
297
|
return CARD_VIEW_PROPERTIES_TEMPLATE
|
|
@@ -274,11 +307,11 @@ class _ViewsHandler:
|
|
|
274
307
|
@property
|
|
275
308
|
def MAP_VIEW_PROPERTIES(self) -> str:
|
|
276
309
|
return MAP_VIEW_PROPERTIES_TEMPLATE
|
|
277
|
-
|
|
310
|
+
|
|
278
311
|
@property
|
|
279
312
|
def CALENDAR_VIEW_PROPERTIES(self) -> str:
|
|
280
313
|
return CALENDAR_VIEW_PROPERTIES_TEMPLATE
|
|
281
|
-
|
|
314
|
+
|
|
282
315
|
@property
|
|
283
316
|
def DECK_VIEW_PROPERTIES(self) -> str:
|
|
284
317
|
return DECK_VIEW_PROPERTIES_TEMPLATE
|
|
@@ -326,7 +359,6 @@ class _ViewsHandler:
|
|
|
326
359
|
return VIEW_LINKS_PLANNER_PROMPT_TEMPLATE.format(
|
|
327
360
|
VIEW_LINKS_PROPERTIES=self.VIEW_LINKS_PROPERTIES,
|
|
328
361
|
)
|
|
329
|
-
|
|
330
362
|
|
|
331
363
|
@property
|
|
332
364
|
def VIEW_FILTER_PLANNER_PROMPT(self) -> str:
|
|
@@ -335,11 +367,16 @@ class _ViewsHandler:
|
|
|
335
367
|
)
|
|
336
368
|
|
|
337
369
|
|
|
338
|
-
|
|
339
370
|
class AABPrompts:
|
|
340
371
|
"""Main prompts class that coordinates all prompt handlers."""
|
|
341
|
-
|
|
342
|
-
def __init__(
|
|
372
|
+
|
|
373
|
+
def __init__(
|
|
374
|
+
self,
|
|
375
|
+
core_expressions: dict,
|
|
376
|
+
restricted_objects_list: list[str],
|
|
377
|
+
default_solution_id: str,
|
|
378
|
+
default_application_id: str,
|
|
379
|
+
) -> None:
|
|
343
380
|
# Initialize handlers
|
|
344
381
|
self._objects_fields = _ObjectsFieldsHandler(restricted_objects_list)
|
|
345
382
|
self._views = _ViewsHandler()
|
|
@@ -347,9 +384,9 @@ class AABPrompts:
|
|
|
347
384
|
restricted_objects_list,
|
|
348
385
|
self._objects_fields.STANDARD_OBJECTS_DESCRIPTIONS,
|
|
349
386
|
self._objects_fields.SYSTEM_OBJECTS_DESCRIPTIONS,
|
|
350
|
-
self._views.VIEW_TYPE_DETAILS
|
|
387
|
+
self._views.VIEW_TYPE_DETAILS,
|
|
351
388
|
)
|
|
352
|
-
|
|
389
|
+
|
|
353
390
|
# Store all handlers in a list for easy iteration
|
|
354
391
|
self._handlers = [
|
|
355
392
|
_BreadcrumbsHandler(),
|
|
@@ -359,22 +396,18 @@ class AABPrompts:
|
|
|
359
396
|
_PagePlannerHandler(),
|
|
360
397
|
_PagesHandler(),
|
|
361
398
|
self._planner,
|
|
362
|
-
_RouterHandler(
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
self._planner.PLANNER_EXAMPLES,
|
|
399
|
+
_RouterHandler(),
|
|
400
|
+
_SolutionsApplicationsHandler(
|
|
401
|
+
default_solution_id, default_application_id
|
|
366
402
|
),
|
|
367
|
-
_SolutionsApplicationsHandler(default_solution_id, default_application_id),
|
|
368
403
|
self._views,
|
|
369
404
|
]
|
|
370
|
-
|
|
405
|
+
|
|
371
406
|
def __getattr__(self, name: str):
|
|
372
407
|
"""Automatically delegate method calls to the appropriate handler."""
|
|
373
408
|
for handler in self._handlers:
|
|
374
409
|
if hasattr(handler, name):
|
|
375
410
|
return getattr(handler, name)
|
|
376
|
-
raise AttributeError(
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
411
|
+
raise AttributeError(
|
|
412
|
+
f"'{self.__class__.__name__}' object has no attribute '{name}'"
|
|
413
|
+
)
|
prompts/planner.py
CHANGED
|
@@ -556,8 +556,11 @@ Your only output should be the plan as plain text following the examples.
|
|
|
556
556
|
---
|
|
557
557
|
|
|
558
558
|
<IMPORTANT STEPS [ MANDATORY AND NON-NEGOTIABLE ]>
|
|
559
|
-
Call the `generate_comprehensive_plan` tool to generate a comprehensive plan. ALWAYS CALL THIS TOOL FIRST.
|
|
560
|
-
Make sure
|
|
559
|
+
- Call the `generate_comprehensive_plan` tool to generate a comprehensive plan. ALWAYS CALL THIS TOOL FIRST.
|
|
560
|
+
- Make sure each component of the plan is very detailed, with all the proper details and context.
|
|
561
|
+
- Each of them should say the name of the component, data type, and the details of the component.
|
|
562
|
+
|
|
563
|
+
- Always retuen the exact plan back to the user. Do not add or remove any characters or spaces. This is very important.
|
|
561
564
|
</IMPORTANT STEPS [ MANDATORY AND NON-NEGOTIABLE ]>
|
|
562
565
|
|
|
563
566
|
You will always use these tools in the order specified above. If you miss any of these steps, you will be penalized.
|
prompts/router.py
CHANGED
|
@@ -157,30 +157,12 @@ All SnapApp construction must always follow this strict sequence:
|
|
|
157
157
|
2. Objects
|
|
158
158
|
- Create all data entities first; everything else depends on them.
|
|
159
159
|
|
|
160
|
-
The following are key elements that should be considered when planning an object:
|
|
161
|
-
- track_activities: Whether the object includes activity tracking. This creates logs of all activities on the data stored in the object. This includes activites like emails/SMS notifications, tasks, and PubSub topics. Should be 1 or 0.
|
|
162
|
-
- track_notes: Whether the object allows for notes and comments from the application's users. This creates a notes section for the object. Should be 1 or 0.
|
|
163
|
-
- track_attachments: Whether the object allows for attachments on the data stored in the object like Files, Images, Videos, etc. Should be 1 or 0. This is typically used when there is a non-standard list of attachments that will be added to the record. Alternatively, a field of type `File` or `Image` can be used to store a single file or image attachment when the use case is for a specific file.
|
|
164
|
-
- track_favorites: Whether the object allows users to favorite items of the object. Should be 1 or 0.
|
|
165
|
-
- track_tags: Whether the object allows users to tag items of the object. Should be 1 or 0.
|
|
166
|
-
- track_audit_trails: Whether field-level changes to records of this object will be included in audit trails. Should be 1 or 0.
|
|
167
|
-
- enable_feed: Whether the object is enabled for feed. This creates a user facing chat feed for everyone to comment and interact for the records of the object. Should be 1 or 0.
|
|
168
|
-
- feed_tracking: Whether all changes in the record be logged in the feed. Works like track activities. Should be 1 or 0.
|
|
169
|
-
|
|
170
160
|
3. Fields
|
|
171
161
|
- Add fields only after objects exist.
|
|
172
162
|
- Define business logic for automatically calculated fields (formulas)
|
|
173
163
|
- Define business logic for visibility, validity, requirements, and read-only (show_if, valid_if, required_if, editable_if)
|
|
174
164
|
|
|
175
165
|
When planning objects and fields, always consider necessary business logic and formulaic automations as these are best handled at the time of field creation, which is accomplished by another domain-expert agent.
|
|
176
|
-
|
|
177
|
-
The following are key details to consider when creating a field. When making your plan, these kind of requirements should be implemented within the object and fields section. They should not be a separate portion of the plan.:
|
|
178
|
-
- formula: The formula to calculate the value of the field. Max 1024 characters. Optional. This is an expression that is applied to the field when a new record is updated. If the same expression is set for the formula and initial_values fields, the field will always be set to this and can not be changed by the user. Always use available tools to build expressions and set it here.
|
|
179
|
-
- initial_value: Define the initial value of the field. Max 1024 characters. This is an expression that is applied to the field when a new record is created. If the same expression is set for the formula and initial_values fields, the field will always be set to this and can not be changed by the user. Always use available tools to build expressions and set it here.
|
|
180
|
-
- show_if: The show if condition for the field. This is an expression that defines when the field should be shown to the user. If the expression evaluates to true, the field is shown. If it evaluates to false, the field is hidden. ALways use available tools to build expressions and set it here.
|
|
181
|
-
- valid_if: The valid if condition for the field. This is an expression that defines when the field value is valid. If the expression evaluates to true, the field value is valid. If it evaluates to false, the field value is invalid. Always use available tools to build expressions and set it here.
|
|
182
|
-
- required_if: The required if condition for the field. This is an expression that defines when the field is required. If the expression evaluates to true, the field is required. If it evaluates to false, the field is not required. Always use available tools to build expressions and set it here.
|
|
183
|
-
- editable_if: The editable if condition for the field. This is an expression that defines when the field is editable. If the expression evaluates to true, the field is editable. If it evaluates to false, the field is read-only. Always use available tools to build expressions and set it here.
|
|
184
166
|
|
|
185
167
|
4. Relationships
|
|
186
168
|
- Define relationships after both participating objects and fields exist.
|
|
@@ -208,32 +190,9 @@ Snappy must always generate Todos in this exact dependency-safe order. If you ha
|
|
|
208
190
|
3. Correct Example: task(subagent="objects", description="Find the table named conversations and list its columns")
|
|
209
191
|
4. Incorrect Example: task(subagent="objects", description="get_object(name='conversations')")
|
|
210
192
|
|
|
211
|
-
### IMPORTANT RULES FOR CREATING OBJECTS:
|
|
212
|
-
|
|
213
|
-
SnapApp is deployed with many standard and system objects that you must be aware of before creating new objects. The user may request objects that have the same name as a standard or system object. In these cases, you must create a custom object with a different name that reflects the user's intent while avoiding conflicts.
|
|
214
|
-
|
|
215
|
-
#### **Standard Objects**
|
|
216
|
-
|
|
217
|
-
You should keep the following standard objects in mind when planning so that you can leverage them where appropriate, and so that you can avoid creating new objects with conflicting names. You should NEVER create an object with the same name as a standard object. If the user's application requires an object of the same name, you should create a unique app-specific name.
|
|
218
|
-
|
|
219
|
-
You can use the `get_object` tool to retrieve the fields and relationships of a standard object. For example `get_object('contacts')` will return the fields and relationships of the Contacts standard object. You should always check the fields before referencing them in your plan or creating new fields that conflict with them.:
|
|
220
|
-
|
|
221
|
-
{STANDARD_OBJECTS_DESCRIPTIONS}
|
|
222
|
-
|
|
223
|
-
#### **System Objects**
|
|
224
|
-
|
|
225
|
-
The following are system objects. You should NEVER create new objects with these names. If the user's application requires an object of the same name, you should create a unique app-specific name. (e.g., Applications is a system object, so any app that tracks applications will need a custom name like "Grant Applications"). You should not modify these objects (such as by adding fields to them):
|
|
226
|
-
|
|
227
|
-
{SYSTEM_OBJECTS_DESCRIPTIONS}
|
|
228
|
-
|
|
229
193
|
### Planning a Solution Build
|
|
230
194
|
|
|
231
|
-
The planning of a solution should
|
|
232
|
-
|
|
233
|
-
{PLANNER_EXAMPLES}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
ALWAYS PROVIDE ALL ANSWERS IN MARKDOWN FORMAT.
|
|
195
|
+
The planning of a solution should always call the planner subagent to generate a detailed plan. Always remember to return the very detailed and ellaborate plan to the user.
|
|
237
196
|
|
|
238
197
|
# ABSOLUTELY PROHIBITED ACTIONS, WHICH ARE MANDATORY AND NON NEGOTIABLE
|
|
239
198
|
NEVER CALL THESE FOLLOWING TOOLS:
|
|
@@ -244,4 +203,37 @@ NEVER CALL THESE FOLLOWING TOOLS:
|
|
|
244
203
|
- `write_file`
|
|
245
204
|
- `edit_file`
|
|
246
205
|
|
|
206
|
+
|
|
207
|
+
<VERY_IMPORTANT_AND_NON_NEGOTIABLE_INSTRUCTIONS>
|
|
208
|
+
- YOU MUST NOT MAKE A PLAN OF YOUR OWN.
|
|
209
|
+
You must always use the `generate_comprehensive_plan` tool to get the plan created by the `planner` subagent,
|
|
210
|
+
and then execute that plan by following the lifecycle of a plan phase execution mentioned below.
|
|
211
|
+
- You MUST NOT continue without having a plan. The generated plan should be fetched by using `get_plan` tool.
|
|
212
|
+
|
|
213
|
+
- Once you have the plan, you will start working in different plan phases. The plan phases are:
|
|
214
|
+
- `solutions_and_applications`
|
|
215
|
+
- `objects_and_fields`
|
|
216
|
+
- `views`
|
|
217
|
+
- `menus_and_navigations`
|
|
218
|
+
- `pages`
|
|
219
|
+
- `breadcrumbs`
|
|
220
|
+
|
|
221
|
+
- Lifecycle of a plan phase execution (YOU MUST FOLLOW THIS ORDER):
|
|
222
|
+
1. Call the `get_plan` tool to get the plan, this makes sure you don't miss any details and you have a clear understanding of the tasks to be executed in that phase.
|
|
223
|
+
2. Execute the tasks of that phase by delegating to the appropriate subagent using the `task` tool.
|
|
224
|
+
3. After executing the tasks of that phase, use the `ensure_progress` tool to ensure that the plan is being followed throughly.
|
|
225
|
+
4. After executing the tasks of that phase, use the `ensure_cleanup` tool to ensure that any invalid, duplicate, or inconsistent data resources are identified and marked for cleanup.
|
|
226
|
+
5. Rinse and repeat for the next plan phase until all phases are complete.
|
|
227
|
+
</VERY_IMPORTANT_AND_NON_NEGOTIABLE_INSTRUCTIONS>
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
<PLAN_PHASES_YOU_MUST_FOLLOW>
|
|
231
|
+
The plan phases are:
|
|
232
|
+
1. `solutions_and_applications`: In this phase, you will create the solution and application containers based on the user requirements. This is the foundational step for organizing a SnapApp application.
|
|
233
|
+
2. `objects_and_fields`: In this phase, you will create the data model by defining objects (tables) and their fields (columns). This is a critical step as everything else depends on the data model.
|
|
234
|
+
3. `views`: In this phase, you will create the views (list/detail/form/create) based on the objects and fields defined in the previous phase. Views are essential for users to interact with the data.
|
|
235
|
+
4. `menus_and_navigations`: In this phase, you will set up the navigation structure, including menus and navigation paths, to ensure users can easily access different parts of the application.
|
|
236
|
+
5. `pages`: In this phase, you will create custom pages if required by the user. Pages are used for building custom UIs and dashboards.
|
|
237
|
+
6. `breadcrumbs`: In this phase, you will set up breadcrumbs for better navigation and user experience, allowing users to understand their location within the application and easily navigate back to previous pages.
|
|
238
|
+
</PLAN_PHASES_YOU_MUST_FOLLOW>
|
|
247
239
|
"""
|
|
File without changes
|
|
File without changes
|