You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/WebGenAI.md
+56-4Lines changed: 56 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -115,13 +115,65 @@ The underlying services are also available in the [genai CLI](WebGenAI-CLI.md){:
115
115
116
116
## Prompt Design
117
117
118
-
Notes reqarding prompts:
118
+
Prompt design is "AI Programming". Consider the following.
119
119
120
-
1. You can provide a very general prompt (*an auto dealership*), or a specific one that identifies specific tables, columns and relationships (for example, [click here](https://github.com/ApiLogicServer/ApiLogicServer-src/blob/main/tests/test_databases/ai-created/budget_allocation/budget_allocations/genai.prompt){:target="_blank" rel="noopener"}).
120
+
121
+
122
+
### Business Area
123
+
124
+
You can provide a very general prompt, for example:
125
+
126
+
*`an auto dealership`, or
127
+
*`a restaurant`
128
+
129
+
130
+
131
+
### Database Oriented
132
+
133
+
Or, you can provide a specific prompt that identifies specific tables, columns and relationships (for example,
134
+
135
+
```bash title='Database, API and Web App'
136
+
Create a system for Customer, Orders, Items and Products
137
+
```
138
+
139
+
140
+
141
+
### With Logic
142
+
143
+
Particularly interesting is that you can declare backend behavior with rules:
144
+
145
+
```bash title='Database, API, Web App and Logic'
146
+
Create a system with customers, orders, items and products.
147
+
148
+
Include a notes field for orders.
149
+
150
+
Use LogicBank to create declare_logic() to enforce the Check Credit requirement (do not generate check constraints):
151
+
1. Customer.balance <= credit_limit
152
+
2. Customer.balance = Sum(Order.amount_total where date_shipped is null)
153
+
3. Order.amount_total = Sum(Item.amount)
154
+
4. Item.amount = quantity * unit_price
155
+
5. Store the Item.unit_price as a copy from Product.unit_price
156
+
```
157
+
158
+
You can verify this by altering a sample order/item with a very high quantity, and verifying the credit limit is checked. (Note this is not trivial - 3 table transaction.)
159
+
160
+
> Note: at the time of this writing, the sample data sometimes does not totally reflect the derivation rules. This is under investigation.
161
+
162
+
163
+
164
+
### Iterations
165
+
166
+
You can *iterate* your prompt to include more tables etc, while preserving the design you have already created.
167
+
168
+
* This enables you to break your system down into a set of "Use Cases", solving one at a time, and integrating back to the others.
169
+
170
+
171
+
172
+
### Limitations
121
173
122
-
2. You can *iterate* your prompt to include more tables etc, while preserving the design you have already created.
174
+
The created systems are basic database applications, not completed systems with sophisticated functionality such as images, custom screens, etc.
123
175
124
-
* This enables you to break your system down into a set of "Use Cases", solving one at a time, and integrating back to the others.
176
+
You can "build out" the project by downloading it and using your IDE with Python and rules, or perform the same functions using Codespaces (a browser-based version of VSCode - a link is provided for this).
0 commit comments