@askdb/config 1.0.0-beta.12 → 1.0.0-beta.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -17
- package/dist/bootstrap.d.ts +3 -0
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +16 -0
- package/dist/bootstrap.js.map +1 -1
- package/dist/constants.d.ts +15 -4
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +15 -4
- package/dist/constants.js.map +1 -1
- package/dist/defaults.d.ts +33 -1
- package/dist/defaults.d.ts.map +1 -1
- package/dist/defaults.js +46 -10
- package/dist/defaults.js.map +1 -1
- package/dist/diagnostics.d.ts +10 -0
- package/dist/diagnostics.d.ts.map +1 -0
- package/dist/diagnostics.js +13 -0
- package/dist/diagnostics.js.map +1 -0
- package/dist/flatten.d.ts +8 -1
- package/dist/flatten.d.ts.map +1 -1
- package/dist/flatten.js +100 -116
- package/dist/flatten.js.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/normalize.d.ts +53 -0
- package/dist/normalize.d.ts.map +1 -0
- package/dist/normalize.js +398 -0
- package/dist/normalize.js.map +1 -0
- package/dist/projection.d.ts +12 -1
- package/dist/projection.d.ts.map +1 -1
- package/dist/projection.js +12 -3
- package/dist/projection.js.map +1 -1
- package/dist/runtime-config.d.ts +43 -3
- package/dist/runtime-config.d.ts.map +1 -1
- package/dist/runtime-config.js +57 -12
- package/dist/runtime-config.js.map +1 -1
- package/dist/runtime-store.d.ts +5 -0
- package/dist/runtime-store.d.ts.map +1 -1
- package/dist/runtime-store.js +20 -5
- package/dist/runtime-store.js.map +1 -1
- package/dist/scaffold/ai.d.ts +30 -0
- package/dist/scaffold/ai.d.ts.map +1 -0
- package/dist/scaffold/ai.js +54 -0
- package/dist/scaffold/ai.js.map +1 -0
- package/dist/scaffold/index.d.ts +8 -0
- package/dist/scaffold/index.d.ts.map +1 -0
- package/dist/scaffold/index.js +7 -0
- package/dist/scaffold/index.js.map +1 -0
- package/dist/types.d.ts +174 -106
- package/dist/types.d.ts.map +1 -1
- package/package.json +9 -4
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AskDbDialectId, AskDbLogLevel, AskDbModeV1, AskDbRagEmbedder, AskDbRagStore, AskDbReasoningEffort, AskDbStudioExecuteProvider } from "./constants.js";
|
|
1
|
+
import type { AskDbAiProviderId, AskDbDialectId, AskDbLogLevel, AskDbModeV1, AskDbRagEmbedder, AskDbRagStore, AskDbReasoningEffort, AskDbStudioExecuteProvider } from "./constants.js";
|
|
2
2
|
/**
|
|
3
3
|
* Authoring-time AskDB configuration: nested groups (`ai`, `introspection`, `rag`, …)
|
|
4
4
|
* passed to {@link defineConfig} in `askdb.config.*`, then flattened to canonical env keys for the runtime snapshot.
|
|
@@ -7,48 +7,104 @@ import type { AskDbDialectId, AskDbLogLevel, AskDbModeV1, AskDbRagEmbedder, AskD
|
|
|
7
7
|
* `defineConfig({ ... } satisfies AskDbConfig)` or `const cfg = { ... } satisfies AskDbConfig`.
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
/** Legacy model fields every connection type still accepts until the 1.0 cutover. */
|
|
11
|
+
type LegacyConnectionModel = {
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use `ai.language.model`. Translated at load (with a warning) when this is the
|
|
14
|
+
* language section's connection, ignored on any other connection. Removed at 1.0.
|
|
15
|
+
*/
|
|
16
|
+
model?: string;
|
|
17
|
+
};
|
|
18
|
+
/** Legacy Azure / Foundry field, also translated at load until the 1.0 cutover. */
|
|
19
|
+
type LegacyConnectionModelFamily = {
|
|
20
|
+
/** @deprecated Use `ai.language.modelFamily`. Removed at 1.0. */
|
|
21
|
+
modelFamily?: string;
|
|
22
|
+
};
|
|
23
|
+
/** OpenAI connection (`ai.providerConfig.openai`). */
|
|
24
|
+
export type OpenaiConnection = LegacyConnectionModel & {
|
|
25
|
+
/** Flattened to `OPENAI_API_KEY`. */
|
|
11
26
|
apiKey?: string;
|
|
27
|
+
/** Flattened to `OPENAI_BASE_URL`; use it for an OpenAI-compatible endpoint. */
|
|
12
28
|
baseUrl?: string;
|
|
13
|
-
/** When unset, `flattenAskDbConfig` applies the default OpenAI chat model (see `@askdb/config` defaults). */
|
|
14
|
-
model?: string;
|
|
15
29
|
};
|
|
16
|
-
|
|
30
|
+
/** Azure OpenAI connection (`ai.providerConfig.azure`). */
|
|
31
|
+
export type AzureConnection = LegacyConnectionModel & LegacyConnectionModelFamily & {
|
|
17
32
|
apiKey?: string;
|
|
18
33
|
secondaryApiKey?: string;
|
|
19
|
-
baseUrl?: string;
|
|
20
|
-
/** When unset, `flattenAskDbConfig` applies the default Azure deployment name (see `@askdb/config` defaults). */
|
|
21
|
-
model?: string;
|
|
22
|
-
apiVersion?: string;
|
|
23
34
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* alone — set this when your deployment name doesn't match the model id.
|
|
35
|
+
* Azure resource name — the subdomain of your endpoint, e.g. `"my-foundry"`
|
|
36
|
+
* for `https://my-foundry.openai.azure.com`. One of `resourceName` or
|
|
37
|
+
* `baseUrl` is required.
|
|
28
38
|
*/
|
|
29
|
-
|
|
39
|
+
resourceName?: string;
|
|
40
|
+
/** Full endpoint URL. Overrides `resourceName` when both are set. */
|
|
41
|
+
baseUrl?: string;
|
|
42
|
+
apiVersion?: string;
|
|
30
43
|
};
|
|
31
|
-
|
|
44
|
+
/** Microsoft Foundry connection (`ai.providerConfig.foundry`): the same fields as {@link AzureConnection}. */
|
|
45
|
+
export type FoundryConnection = AzureConnection;
|
|
46
|
+
/** Anthropic connection (`ai.providerConfig.anthropic`). Anthropic has no embeddings API. */
|
|
47
|
+
export type AnthropicConnection = LegacyConnectionModel & {
|
|
32
48
|
apiKey?: string;
|
|
33
|
-
secondaryApiKey?: string;
|
|
34
|
-
model?: string;
|
|
35
|
-
apiVersion?: string;
|
|
36
49
|
baseUrl?: string;
|
|
37
|
-
/** See {@link AzureConfig.modelFamily}. */
|
|
38
|
-
modelFamily?: string;
|
|
39
50
|
};
|
|
40
|
-
|
|
51
|
+
/** Google Gemini connection (`ai.providerConfig.google`). */
|
|
52
|
+
export type GoogleConnection = LegacyConnectionModel & {
|
|
41
53
|
apiKey?: string;
|
|
42
54
|
baseUrl?: string;
|
|
43
|
-
/** When unset, `flattenAskDbConfig` applies the default Anthropic chat model (see `@askdb/config` defaults). */
|
|
44
|
-
model?: string;
|
|
45
55
|
};
|
|
46
|
-
|
|
56
|
+
/** Vercel AI Gateway connection (`ai.providerConfig.gateway`), built into `ai` — no extra provider package. */
|
|
57
|
+
export type GatewayConnection = LegacyConnectionModel & {
|
|
58
|
+
/** AI Gateway API key. Flattened to `AI_GATEWAY_API_KEY`. */
|
|
47
59
|
apiKey?: string;
|
|
48
60
|
baseUrl?: string;
|
|
49
|
-
/** When unset, `flattenAskDbConfig` applies the default Gemini chat model (see `@askdb/config` defaults). */
|
|
50
|
-
model?: string;
|
|
51
61
|
};
|
|
62
|
+
/**
|
|
63
|
+
* Connection for a provider AskDB has no dedicated type for, keyed by its provider id
|
|
64
|
+
* (`ai.providerConfig.mistral`). Flattened to the universal `ASKDB_AI_*` keys; works end to
|
|
65
|
+
* end only when the consuming registry has an adapter registered under that provider id.
|
|
66
|
+
*/
|
|
67
|
+
export type CustomConnection = LegacyConnectionModel & {
|
|
68
|
+
apiKey?: string;
|
|
69
|
+
baseUrl?: string;
|
|
70
|
+
};
|
|
71
|
+
/** A connection plus its name, unique within its provider. */
|
|
72
|
+
export type AiNamedConnection<T> = T & {
|
|
73
|
+
/** Defaults to `"default"`. Unique within its provider. */
|
|
74
|
+
name?: string;
|
|
75
|
+
};
|
|
76
|
+
/** One connection, or a list of them when a provider needs more than one (for example two Azure resources). */
|
|
77
|
+
export type AiConnections<T> = AiNamedConnection<T> | readonly AiNamedConnection<T>[];
|
|
78
|
+
/**
|
|
79
|
+
* `ai.providerConfig`: provider connections only (keys, endpoints, resources, API versions),
|
|
80
|
+
* keyed by provider id. The model choice lives in `ai.language` and `ai.embedding`.
|
|
81
|
+
*/
|
|
82
|
+
export type AiProviderConnections = {
|
|
83
|
+
openai?: AiConnections<OpenaiConnection>;
|
|
84
|
+
azure?: AiConnections<AzureConnection>;
|
|
85
|
+
foundry?: AiConnections<FoundryConnection>;
|
|
86
|
+
anthropic?: AiConnections<AnthropicConnection>;
|
|
87
|
+
google?: AiConnections<GoogleConnection>;
|
|
88
|
+
gateway?: AiConnections<GatewayConnection>;
|
|
89
|
+
/**
|
|
90
|
+
* Any other key is a custom provider id (an adapter registered under that name), whose
|
|
91
|
+
* connection is a {@link CustomConnection}. TypeScript also checks the keys above against this
|
|
92
|
+
* signature, so it accepts the widest built-in connection (Azure's) too.
|
|
93
|
+
*/
|
|
94
|
+
[provider: string]: AiConnections<CustomConnection> | AiConnections<AzureConnection> | undefined;
|
|
95
|
+
};
|
|
96
|
+
/** @deprecated Use {@link OpenaiConnection}. Removed at 1.0. */
|
|
97
|
+
export type OpenaiConfig = OpenaiConnection;
|
|
98
|
+
/** @deprecated Use {@link AzureConnection}. Removed at 1.0. */
|
|
99
|
+
export type AzureConfig = AzureConnection;
|
|
100
|
+
/** @deprecated Use {@link FoundryConnection}. Removed at 1.0. */
|
|
101
|
+
export type FoundryConfig = FoundryConnection;
|
|
102
|
+
/** @deprecated Use {@link AnthropicConnection}. Removed at 1.0. */
|
|
103
|
+
export type AnthropicConfig = AnthropicConnection;
|
|
104
|
+
/** @deprecated Use {@link GoogleConnection}. Removed at 1.0. */
|
|
105
|
+
export type GoogleConfig = GoogleConnection;
|
|
106
|
+
/** @deprecated Use {@link GatewayConnection}. Removed at 1.0. */
|
|
107
|
+
export type GatewayConfig = GatewayConnection;
|
|
52
108
|
/**
|
|
53
109
|
* Provider-portable reasoning/latency effort for AskDB model calls. Unset
|
|
54
110
|
* (the default) preserves current behavior: no reasoning `providerOptions`
|
|
@@ -68,92 +124,78 @@ export type AskDbAiReasoningConfig = {
|
|
|
68
124
|
*/
|
|
69
125
|
enrichment?: AskDbReasoningEffort;
|
|
70
126
|
};
|
|
71
|
-
/**
|
|
72
|
-
export type
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
reasoning?: AskDbAiReasoningConfig;
|
|
86
|
-
};
|
|
87
|
-
/** Discriminated union branch for `ai` when `provider` is `"azure"`. */
|
|
88
|
-
export type AzureAiConfig = {
|
|
89
|
-
provider: "azure";
|
|
90
|
-
providerConfig: AiProviderConfigs & {
|
|
91
|
-
azure: AzureConfig;
|
|
92
|
-
};
|
|
93
|
-
reasoning?: AskDbAiReasoningConfig;
|
|
94
|
-
};
|
|
95
|
-
/** Discriminated union branch for `ai` when `provider` is `"foundry"`. */
|
|
96
|
-
export type FoundryAiConfig = {
|
|
97
|
-
provider: "foundry";
|
|
98
|
-
providerConfig: AiProviderConfigs & {
|
|
99
|
-
foundry: FoundryConfig;
|
|
100
|
-
};
|
|
101
|
-
reasoning?: AskDbAiReasoningConfig;
|
|
102
|
-
};
|
|
103
|
-
/** Discriminated union branch for `ai` when `provider` is `"anthropic"`. */
|
|
104
|
-
export type AnthropicAiConfig = {
|
|
105
|
-
provider: "anthropic";
|
|
106
|
-
providerConfig: AiProviderConfigs & {
|
|
107
|
-
anthropic: AnthropicConfig;
|
|
108
|
-
};
|
|
109
|
-
reasoning?: AskDbAiReasoningConfig;
|
|
110
|
-
};
|
|
111
|
-
/** Discriminated union branch for `ai` when `provider` is `"google"`. */
|
|
112
|
-
export type GoogleAiConfig = {
|
|
113
|
-
provider: "google";
|
|
114
|
-
providerConfig: AiProviderConfigs & {
|
|
115
|
-
google: GoogleConfig;
|
|
116
|
-
};
|
|
127
|
+
/** `ai.language`: the language model AskDB generates SQL and enrichment suggestions with. */
|
|
128
|
+
export type AskDbAiLanguageConfig = {
|
|
129
|
+
/** Defaults to `ai.provider`. */
|
|
130
|
+
provider?: AskDbAiProviderId | (string & {});
|
|
131
|
+
/** Name of a connection in `ai.providerConfig.<provider>`. Defaults to `"default"`. */
|
|
132
|
+
connection?: string;
|
|
133
|
+
/** Defaults to the provider's default language model (none for a custom provider). On Azure, the deployment name. */
|
|
134
|
+
model?: string;
|
|
135
|
+
/**
|
|
136
|
+
* Underlying model id when `model` is an alias, e.g. `"gpt-5"` or `"o3-mini"` behind an Azure
|
|
137
|
+
* deployment name. Deployment names are arbitrary, so AskDB can't always infer reasoning-model
|
|
138
|
+
* support from `model` alone. Read on Azure and Foundry.
|
|
139
|
+
*/
|
|
140
|
+
modelFamily?: string;
|
|
117
141
|
reasoning?: AskDbAiReasoningConfig;
|
|
118
142
|
};
|
|
119
|
-
/**
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
143
|
+
/** `ai.embedding`: the embedding model behind `rag.embedder: "ai"`. Ignored when `rag.embedder` is `"mock"`. */
|
|
144
|
+
export type AskDbAiEmbeddingConfig = {
|
|
145
|
+
/** Defaults to `ai.provider`. Anthropic has no embeddings API, so it can't be this section's provider. */
|
|
146
|
+
provider?: AskDbAiProviderId | (string & {});
|
|
147
|
+
/** Name of a connection in `ai.providerConfig.<provider>`. Defaults to `"default"`. */
|
|
148
|
+
connection?: string;
|
|
149
|
+
/** Required when `rag.embedder` is `"ai"`: AskDB has no default embedding model. On Azure, the deployment name. */
|
|
125
150
|
model?: string;
|
|
151
|
+
/**
|
|
152
|
+
* Vector size to request from the provider, as a positive integer or a string holding one, for
|
|
153
|
+
* models that let you choose one (OpenAI's text-embedding-3 models, Gemini's). Unset: the
|
|
154
|
+
* model's own width, which AskDB learns from the model when it builds an index.
|
|
155
|
+
*/
|
|
156
|
+
dimensions?: string | number;
|
|
126
157
|
};
|
|
127
|
-
/**
|
|
128
|
-
*
|
|
158
|
+
/**
|
|
159
|
+
* `ai`: provider connections plus one section per use of a model.
|
|
129
160
|
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
custom?: CustomProviderConfig;
|
|
146
|
-
};
|
|
161
|
+
* - **`provider`**: the default provider for both sections.
|
|
162
|
+
* - **`providerConfig`**: provider connections, keyed by provider id.
|
|
163
|
+
* - **`language`**: the language model (NL→SQL, enrichment suggestions).
|
|
164
|
+
* - **`embedding`**: the embedding model behind `rag.embedder: "ai"`.
|
|
165
|
+
*
|
|
166
|
+
* A section's provider is `section.provider ?? ai.provider`, and its connection is
|
|
167
|
+
* `section.connection ?? "default"` within that provider. Loading fails when a section resolves
|
|
168
|
+
* to no provider or to a connection that doesn't exist.
|
|
169
|
+
*/
|
|
170
|
+
export type AskDbAiConfig = {
|
|
171
|
+
provider?: AskDbAiProviderId | (string & {});
|
|
172
|
+
providerConfig?: AiProviderConnections;
|
|
173
|
+
language?: AskDbAiLanguageConfig;
|
|
174
|
+
embedding?: AskDbAiEmbeddingConfig;
|
|
175
|
+
/** @deprecated Use `ai.language.reasoning`. Removed at 1.0. */
|
|
147
176
|
reasoning?: AskDbAiReasoningConfig;
|
|
148
177
|
};
|
|
149
|
-
/**
|
|
150
|
-
|
|
151
|
-
|
|
178
|
+
/** @deprecated Use {@link AskDbAiConfig}. Removed at 1.0. */
|
|
179
|
+
export type OpenaiAiConfig = AskDbAiConfig;
|
|
180
|
+
/** @deprecated Use {@link AskDbAiConfig}. Removed at 1.0. */
|
|
181
|
+
export type AzureAiConfig = AskDbAiConfig;
|
|
182
|
+
/** @deprecated Use {@link AskDbAiConfig}. Removed at 1.0. */
|
|
183
|
+
export type FoundryAiConfig = AskDbAiConfig;
|
|
184
|
+
/** @deprecated Use {@link AskDbAiConfig}. Removed at 1.0. */
|
|
185
|
+
export type AnthropicAiConfig = AskDbAiConfig;
|
|
186
|
+
/** @deprecated Use {@link AskDbAiConfig}. Removed at 1.0. */
|
|
187
|
+
export type GoogleAiConfig = AskDbAiConfig;
|
|
188
|
+
/** @deprecated Use {@link AskDbAiConfig}. Removed at 1.0. */
|
|
189
|
+
export type GatewayAiConfig = AskDbAiConfig;
|
|
190
|
+
/** @deprecated Use `ai.embedding` and a connection in `ai.providerConfig`. Translated at load (with a warning); removed at 1.0. */
|
|
152
191
|
export type OpenaiRagEmbedderConfig = {
|
|
192
|
+
/** @deprecated Use `ai.embedding.model`. */
|
|
153
193
|
model?: string;
|
|
154
|
-
/**
|
|
194
|
+
/** @deprecated Use `ai.embedding.dimensions`. */
|
|
155
195
|
dimension?: string | number;
|
|
196
|
+
/** @deprecated Put the key on a connection in `ai.providerConfig`. */
|
|
156
197
|
apiKey?: string;
|
|
198
|
+
/** @deprecated Put the base URL on a connection in `ai.providerConfig`. */
|
|
157
199
|
baseUrl?: string;
|
|
158
200
|
};
|
|
159
201
|
export type FileStoreConfig = {
|
|
@@ -167,7 +209,11 @@ export type PgvectorStoreConfig = {
|
|
|
167
209
|
/** Connection string for pgvector (maps to `ASKDB_PGVECTOR_URL`). */
|
|
168
210
|
databaseUrl?: string;
|
|
169
211
|
table?: string;
|
|
170
|
-
/**
|
|
212
|
+
/**
|
|
213
|
+
* @deprecated Ignored with `rag.embedder: "mock"`, whose vectors are always 64 wide (a load warning
|
|
214
|
+
* says so). With `rag.embedder: "ai"`, use `ai.embedding.dimensions` (translated at load, with a
|
|
215
|
+
* warning). Removed at 1.0.
|
|
216
|
+
*/
|
|
171
217
|
dimensions?: string | number;
|
|
172
218
|
/** When unset, {@link flattenAskDbConfig} uses `hnsw`. */
|
|
173
219
|
indexStrategy?: string;
|
|
@@ -308,9 +354,9 @@ export type AskDbIntrospectionConfig = PostgresIntrospectionConfig | PrismaIntro
|
|
|
308
354
|
/**
|
|
309
355
|
* Root shape for `export default defineConfig({ ... })` in `askdb.config.*`.
|
|
310
356
|
*
|
|
311
|
-
* - **`ai`**:
|
|
357
|
+
* - **`ai`**: provider connections (`providerConfig`) plus the `language` and `embedding` model sections.
|
|
312
358
|
* - **`introspection`**: target engine for `askdb introspect` (postgres / prisma / mysql / sqlite / sqlserver) — selecting `provider` determines which `providerConfig` branch is valid. Each branch holds the connection URL/path for that engine.
|
|
313
|
-
* - **`rag
|
|
359
|
+
* - **`rag`** (optional): the embedder (`"mock"`, or `"ai"` for `ai.embedding`) and the vector store, flattened to `ASKDB_RAG_*` / `ASKDB_PGVECTOR_URL` / file paths. Omitting it means the mock embedder and the in-memory store.
|
|
314
360
|
* - **`logging` | `modes` | `host`**: optional operational defaults.
|
|
315
361
|
*/
|
|
316
362
|
export type AskDbConfig = {
|
|
@@ -325,9 +371,17 @@ export type AskDbConfig = {
|
|
|
325
371
|
* Keep aligned with `DialectId` in `@askdb/core`. Shipped specs: see `ASKDB_DIALECTS`.
|
|
326
372
|
*/
|
|
327
373
|
dialect?: AskDbDialectId;
|
|
328
|
-
|
|
374
|
+
/**
|
|
375
|
+
* Retrieval (RAG): the embedder and the vector store. Optional: omit it when you don't use
|
|
376
|
+
* retrieval, and AskDB behaves as if `{ embedder: "mock", store: "memory", storeConfig: {} }`
|
|
377
|
+
* were set, so no store keys are written. Setting `ai.embedding` without it is an error, since
|
|
378
|
+
* nothing would use that model. When present, `embedder`, `store` and `storeConfig` are required.
|
|
379
|
+
*/
|
|
380
|
+
rag?: {
|
|
381
|
+
/** `"mock"` (a local lexical embedder) or `"ai"` (the `ai.embedding` model). `"openai"` and `"ai-sdk"` are deprecated. */
|
|
329
382
|
embedder: AskDbRagEmbedder;
|
|
330
|
-
|
|
383
|
+
/** @deprecated Use `ai.embedding` and a connection in `ai.providerConfig`. Translated at load (with a warning); removed at 1.0. */
|
|
384
|
+
embedderConfig?: {
|
|
331
385
|
openai?: OpenaiRagEmbedderConfig;
|
|
332
386
|
};
|
|
333
387
|
store: AskDbRagStore;
|
|
@@ -416,6 +470,20 @@ export type AskDbConfig = {
|
|
|
416
470
|
port?: number;
|
|
417
471
|
host?: string;
|
|
418
472
|
};
|
|
473
|
+
/**
|
|
474
|
+
* Accept a per-request `schemaJson` override on `POST /ask`. Default `false`: an override
|
|
475
|
+
* lets any caller send arbitrary schema/prompt content through the server's model key, so
|
|
476
|
+
* enable it only for tests or trusted multi-schema deployments.
|
|
477
|
+
* Maps to `ASKDB_HTTP_ALLOW_SCHEMA_OVERRIDE`.
|
|
478
|
+
*/
|
|
479
|
+
allowSchemaOverride?: boolean;
|
|
480
|
+
/**
|
|
481
|
+
* Abort the model call for a `POST /ask` request after this many milliseconds (positive
|
|
482
|
+
* integer, at most `2147483647`, the Node timer maximum; larger values are a config error).
|
|
483
|
+
* Default `60000`. Maps to `ASKDB_HTTP_REQUEST_TIMEOUT_MS`.
|
|
484
|
+
*/
|
|
485
|
+
requestTimeoutMs?: number;
|
|
419
486
|
};
|
|
420
487
|
};
|
|
488
|
+
export {};
|
|
421
489
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,oBAAoB,EACpB,0BAA0B,EAC3B,MAAM,gBAAgB,CAAC;AAExB;;;;;;;GAOG;AAMH,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,oBAAoB,EACpB,0BAA0B,EAC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0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.14",
|
|
4
4
|
"description": "AskDB configuration helpers: Prisma-style env() and askdb.config file discovery for first-party apps.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"askdb",
|
|
@@ -27,6 +27,11 @@
|
|
|
27
27
|
"types": "./dist/index.d.ts",
|
|
28
28
|
"import": "./dist/index.js",
|
|
29
29
|
"default": "./dist/index.js"
|
|
30
|
+
},
|
|
31
|
+
"./scaffold": {
|
|
32
|
+
"types": "./dist/scaffold/index.d.ts",
|
|
33
|
+
"import": "./dist/scaffold/index.js",
|
|
34
|
+
"default": "./dist/scaffold/index.js"
|
|
30
35
|
}
|
|
31
36
|
},
|
|
32
37
|
"files": [
|
|
@@ -36,15 +41,15 @@
|
|
|
36
41
|
"NOTICE"
|
|
37
42
|
],
|
|
38
43
|
"engines": {
|
|
39
|
-
"node": ">=22.
|
|
44
|
+
"node": ">=22.23.4"
|
|
40
45
|
},
|
|
41
46
|
"dependencies": {
|
|
42
|
-
"dotenv": "^
|
|
47
|
+
"dotenv": "^18.0.9",
|
|
43
48
|
"jiti": "^2.7.0"
|
|
44
49
|
},
|
|
45
50
|
"devDependencies": {
|
|
46
51
|
"typescript": "^6.0.3",
|
|
47
|
-
"vitest": "^5.0.
|
|
52
|
+
"vitest": "^5.0.5"
|
|
48
53
|
},
|
|
49
54
|
"scripts": {
|
|
50
55
|
"build": "tsc -p tsconfig.build.json",
|