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.
In this case during publish call it will check all users who subscribed to the topic and do actual publish to only those who are allowed to receive the message. This method requires more CPU resources and generally is not recommended.
264
+
In this case during publish call it will check all users who subscribed to the topic and do actual publish to only those who are allowed to receive the message. This method requires more CPU resources and generally is not recommended.
Copy file name to clipboardExpand all lines: adminforth/documentation/docs/tutorial/05-Adapters/05-ai-completion-adapters.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -129,7 +129,7 @@ new CompletionAdapterOpenAIResponses({
129
129
130
130
You can specify any GPT model you need. The default is `gpt-5-nano` as it is cheapest though may behave weakly.
131
131
132
-
By default, this adapter uses the OpenAI `responses` API (`v1/responses`) unless `useComplitionApi` is set to `true`. If `useComplitionApi` is `true`, it uses the older Chat Completions API (`v1/chat/completions`).
132
+
By default, this adapter uses the OpenAI `responses` API (`v1/responses`) unless `useCompletionApi` is set to `true`. If `useCompletionApi` is `true`, it uses the older Chat Completions API (`v1/chat/completions`).
133
133
134
134
135
135
### Using with OpenAI-compatible API providers (for example based on self-hosted vLLM docker images)
@@ -141,25 +141,25 @@ new CompletionAdapterOpenAIResponses({
If `useComplitionApi` is omitted, the adapter keeps the current default behavior:
151
+
If `useCompletionApi` is omitted, the adapter keeps the current default behavior:
152
152
153
153
- official OpenAI uses the `responses` API
154
154
- custom `baseUrl` providers use the Chat Completions API.
155
155
156
-
This is because many OpenAI-compatible providers do not yet support the `responses` API or support it unstably (for example OVH AI Endpoints still - Apr 2026 does not fully support the `responses`, so `useComplitionApi: false` may work unstably there, though you can re-test it by manually enabling it by setting `useComplitionApi: true` and checking if it works).
156
+
This is because many OpenAI-compatible providers do not yet support the `responses` API or support it unstably (for example OVH AI Endpoints still - Apr 2026 does not fully support the `responses`, so `useCompletionApi: false` may work unstably there, though you can re-test it by manually enabling it by setting `useCompletionApi: true` and checking if it works).
157
157
Any 3rd-party API providers might have next reasones of pure `responses` API compatibility:
158
158
159
159
1) If they use vLLM open-source software under the hood they might have outdated version
160
160
2) Custom non-vLLM implmentation might have reliable chat API implementation while give less priority to responses API as it is more complex and new.
161
161
162
-
We recommend you to try responses API first by setting `false` in `useComplitionApi` because it gives rich features set, including summarization and better structured outputs, and if it does not work for your provider, then set it to `true` to have less features but working implementation.
162
+
We recommend you to try responses API first by setting `false` in `useCompletionApi` because it gives rich features set, including summarization and better structured outputs, and if it does not work for your provider, then set it to `true` to have less features but working implementation.
0 commit comments