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: adminforth/documentation/docs/tutorial/02-glossary.md
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,25 @@ It used to:
15
15
16
16
There might be several datasources in the system for various databases e.g. One datasource to Mongo DBs and one to Postgres DB.
17
17
18
+
### connectionRecovery
19
+
20
+
For PostgreSQL datasources AdminForth keeps a connection pool. The optional `connectionRecovery` flag controls how the connector reacts when that connection drops (DB restart, failover, network blip, etc.):
21
+
22
+
```ts
23
+
dataSources: [
24
+
{
25
+
id: 'maindb',
26
+
url: `${process.env.DATABASE_URL}`,
27
+
connectionRecovery: true, // default
28
+
},
29
+
],
30
+
```
31
+
32
+
-`true` (default, recommended) — **self-heal mode.** The pool recovers automatically: a dead idle connection is dropped and a fresh one is transparently opened on the next query, so the app keeps working without a manual restart. Queries that were in-flight at the moment of the outage will fail, but subsequent queries succeed once the database is back.
33
+
-`false` — **legacy mode.** On a connection error the pool is destroyed and recreated after 1 second. If the outage outlasts that retry, the app can be left with a permanently dead pool and require a manual restart. Kept only for backward compatibility.
34
+
35
+
This flag is currently honored by the PostgreSQL connector; other connectors rely on their driver's built-in recovery.
36
+
18
37
## resource
19
38
20
39
A [Resource](/docs/api/Back/interfaces/AdminForthResource.md) is a AdminForth representation of a table or collection in database. One resource is one table in the database. Resource has `table` property which should be equal to the name of the table in the database.
Copy file name to clipboardExpand all lines: adminforth/documentation/docs/tutorial/08-Plugins/17-bulk-ai-flow.md
+40Lines changed: 40 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -283,6 +283,31 @@ new BulkAiFlowPlugin({
283
283
}),
284
284
```
285
285
286
+
## Image generation quality
287
+
288
+
`ImageGenerationAdapterOpenAI` accepts an `extraParams` object that is passed directly to the OpenAI API. The most useful option here is `quality`, which controls the fidelity and cost of each generated image:
289
+
290
+
| Value | Description |
291
+
|-------|-------------|
292
+
| `'low'` | Fastest generation, lowest cost. Good for drafts or high-volume batch jobs where speed matters more than visual fidelity. |
293
+
| `'medium'` | Balanced quality and speed. A sensible default for most use cases. |
294
+
| `'high'` | Best image quality, slowest and most expensive. Use for final promotional assets or when visual detail is critical. |
295
+
296
+
```ts
297
+
newImageGenerationAdapterOpenAI({
298
+
openAiApiKey: process.env.OPENAI_API_KEYasstring,
299
+
model: 'gpt-image-1',
300
+
//diff-add
301
+
extraParams: {
302
+
//diff-add
303
+
quality: 'low', // 'low' | 'medium' | 'high'
304
+
//diff-add
305
+
},
306
+
}),
307
+
```
308
+
309
+
> ☝️ `'low'` quality is a great starting point when processing large datasets — you can always re-run generation with `'high'` for selected records once you're happy with the prompts.
310
+
286
311
## Rate Limiting and Best Practices
287
312
288
313
- Use `rateLimit` for individual image generation operations and for the bulk image generation
@@ -429,6 +454,21 @@ If you are processing large sets of data, you might want to limit the number of
429
454
430
455
And there won't be more than 5 parallel requests being handled.
431
456
457
+
## Controlling page size in the generation dialog
458
+
459
+
When users trigger bulk generation, records are displayed as cards in a paginated dialog. By default, 6 cards are shown per page. Use `pageSize` to tune this — lower values help when cards contain large images or long text, keeping the dialog fast and reviewable:
460
+
461
+
```ts
462
+
newBulkAiFlowPlugin({
463
+
actionName: 'Generate description and Price',
464
+
465
+
//diff-add
466
+
pageSize: 10, // default is 6
467
+
468
+
// ...
469
+
}),
470
+
```
471
+
432
472
## Confirming long-running generations
433
473
434
474
For very large datasets, you can pause generation at specific checkpoints so users can review results before continuing.
0 commit comments