Skip to content

Commit 5ea7419

Browse files
committed
logic suggestions
1 parent 0955340 commit 5ea7419

File tree

2 files changed

+58
-2
lines changed

2 files changed

+58
-2
lines changed

docs/IDE-Import-WebGenAI.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,11 @@ Imports are performed from with the dev project, using the `import-genai` CLI co
7272
cd system/genai/examples/genai_demo/wg_dev_merge/dev_demo_no_logic_fixed
7373
als genai-utils --import-genai --using=../wg_demo_no_logic_fixed
7474
```
75+
Observe:
76+
1. The [data model](system/genai/examples/genai_demo/wg_dev_merge/dev_demo_no_logic_fixed/database) contains `Customer.balance` and `Product.carbon_neutral`
77+
2. The test data has been updated to include these attributes, with proper values
7578

76-
That will leave things in this state:
79+
In this example, `als genai-utils --import-genai ...` will leave things in this state:
7780

7881
![genai-process](images/sample-ai/genai/genai-process-merged-models.png)
7982

docs/WebGenAI-CLI.md

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,60 @@ Notes:
264264
265265
### Logic Suggestions
266266
267-
Coming Soon.
267+
You can ask GenAI to suggest logic for your system. This can help you learn about rules, and can inspire your own imagination about required logic.
268+
269+
It's AI, so or course you will want to review the suggestions carefully.
270+
271+
Explore suggestions using the [Manager](Manger.md){:target="_blank" rel="noopener"}:
272+
273+
274+
```bash title='1. Create Project, without Rules'
275+
# 1. Create Project, without Rules
276+
als genai --project-name='genai_demo_no_logic' --using=system/genai/examples/genai_demo/genai_demo_no_logic.prompt
277+
```
278+
279+
```bash title="2. Request Rule Suggestions"
280+
# 2. Request Rule Suggestions
281+
cd genai_demo_no_logic
282+
als genai-logic --suggest
283+
```
284+
285+
You can review the resultant logic suggestions in the `genai_demo_no_logic` project:
286+
287+
* See and edit: `docs/logic_suggestions/002_logic_suggestions.prompt` (used in step 3, below)
288+
* This corresponds to the WebGenAI Logic Editor - Logic View in the WebGenAI web app
289+
290+
```bash title="3. See the rules for the logic"
291+
# 3. See the rule code for the logic
292+
als genai-logic --suggest --logic='*'
293+
```
294+
295+
Important notes about suggestions and generated code:
296+
* `--suggest --logic='*'` is intended to enable you to identify logic that does not translate into proper code
297+
* The example above was pretty good, but sometimes the results are downright silly:
298+
* Just run suggest again, or
299+
* Repair `docs/logic_suggestions/002_logic_suggestions.prompt`
300+
301+
Also...
302+
* It is not advised to paste the code into `logic/declare_logic.py`
303+
* The suggested logic may result in new data model attributes
304+
* These are created automatically by running `als genai` (next step)
305+
306+
The [logic suggestions directory](genai_demo_no_logic/docs/logic_suggestions) now contains the prompts to create a new project with the suggested logic.
307+
When you are ready to proceed:
308+
1. Execute the following to create a *new project* (iteration), with suggested logic:
309+
310+
```bash title="4. Create a new project with the Rule Suggestions"
311+
# 4. Create a new project with the Rule Suggestions
312+
cd .. # important - back to manager root dir
313+
als genai --project-name='genai_demo_with_logic' --using=genai_demo_no_logic/docs/logic_suggestions
314+
```
315+
316+
Observe:
317+
1. The created project has the rule suggestions in `logic/declare_logic.py`
318+
2. A revised Data Model in `database/models.py` that includes attributes introduced by the logic suggestions
319+
3. Revised test database, initialized to reflect the derivations in the suggested logic
320+
268321

269322

270323

0 commit comments

Comments
 (0)