Skip to content

Commit a8a9953

Browse files
committed
fixup and rebuild-test-data
1 parent f34a9a1 commit a8a9953

File tree

5 files changed

+77
-3
lines changed

5 files changed

+77
-3
lines changed

.vscode/Docs.code-workspace

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
}
66
],
77
"settings": {
8-
"workbench.colorTheme": "Colored Theme (Green malachite)",
9-
"workbench.preferredLightColorTheme": "Colored Theme (Green malachite)"
8+
"workbench.colorTheme": "Blue Light Theme",
9+
"workbench.preferredLightColorTheme": "Blue Light Theme"
1010
}
1111
}

docs/IDE-Fixup-Attrs.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
!!! pied-piper ":bulb: TL;DR - Fixup Missing Attributes"
2+
3+
When adding rules, such as using suggestions, you may introduce new attributes.
4+
If these are missing, you will see exceptions when you start your project.
5+
6+
The `genai-utils` fixes such project issues by updating the Data Model and Test Data:
7+
8+
1. Collects the latest model, rules, and test data from the project.
9+
2. Calls ChatGPT (or similar) to resolve missing columns or data in the project.
10+
3. Saves the fixup request/response under a 'fixup' folder.
11+
4. You then use this to create a new project
12+
13+
## Using Fixup
14+
15+
### Setup
16+
After starting the [Manager](Manager.md){:target="_blank" rel="noopener"}:
17+
18+
```bash title="0. Create Project Requiring Fixup"
19+
# 0. Create a project requiring fixup
20+
als genai --using=genai_demo.prompt --repaired-response=system/genai/examples/genai_demo/genai_demo_fixup_required.json --project-name=genai_demo_fixup_required
21+
```
22+
23+
If you run this project, you will observe that it fails with:
24+
```bash
25+
Logic Bank Activation Error -- see https://apilogicserver.github.io/Docs/WebGenAI-CLI/#recovery-options
26+
Invalid Rules: [AttributeError("type object 'Customer' has no attribute 'balance'")]
27+
Missing Attrs (try als genai-utils --fixup): ['Customer.balance: constraint']
28+
```
29+
 
30+
31+
### Fixup
32+
To Fix it:
33+
```bash title="1. Run FixUp to add missing attributes to the fixup response data model"
34+
# 1. Run FixUp to add missing attributes to the data model
35+
cd genai_demo_fixup_required
36+
als genai-utils --fixup
37+
```
38+
39+
Finally, rebuild the project:
40+
```bash title="2. Rebuild the project from the fixup response data model"
41+
# 2. Rebuild the project from the fixup response data model
42+
cd ../
43+
als genai --using=genai_demo.prompt --repaired-response=genai_demo_fixup_required/docs/fixup/response_fixup.json
44+
```
45+
46+
 

docs/IDE-Import-WebGenAI.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
!!! pied-piper ":bulb: TL;DR - Import WebGenAI Project"
2+
3+
You can import WegGenAI projects, merging their data models and rules into a dev project.
4+
5+
Under construction, coming soon.
6+
7+
 

docs/IDE-Rebuild-Test-Data.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
!!! pied-piper ":bulb: TL;DR - Rebuild Test Data"
2+
3+
Proper rule operation requires existing data be correct - see [Data ModelD esign](Data-Model-Design){:target="_blank" rel="noopener"}.
4+
5+
ChatGPT sometimes fails to properly compute the tests data. You can rebuild your test data to match the derivation rules by using `genai-utils --rebuild-test-data`.
6+
7+
8+
Fixes project issues by rebuilding the database to conform to the derivation rules:
9+
10+
1. Create genai_demo: `als genai --using=system/genai/examples/genai_demo/genai_demo.prompt --project-name=genai_demo`
11+
2. Rebuild:
12+
```
13+
cd genai_demo
14+
als genai-utils --rebuild-test-data
15+
```
16+
17+
 

mkdocs.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,11 @@ nav:
9090
- 5. Application Integration:
9191
- "Sample Integration": Sample-Integration.md
9292
- "Integration Mapping": Integration-Map.md
93-
- "Customize Using Your IDE": IDE-Customize.md
93+
- IDE - Customize, Manage:
94+
- "Customize Using Your IDE": IDE-Customize.md
95+
- "Fixup - missing attributes": IDE-Fixup-Attrs.md
96+
- "Import / Merge WebGenai": IDE-Import-WebGenAI.md
97+
- "Rebuild Test Data": IDE-Rebuild-Test-Data.md
9498
- Database:
9599
- "Connection Examples, Debug": Database-Connectivity.md
96100
- "Database Diagram": Database-Diagram.md

0 commit comments

Comments
 (0)