@terreno/ai 57.8.0 → 57.9.0
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/.cursorrules +2 -2
- package/README.md +1 -1
- package/dist/aiApp.d.ts +8 -3
- package/dist/aiApp.js +7 -3
- package/dist/models/gptHistory.js +15 -2
- package/dist/routes/files.js +2 -0
- package/dist/routes/gpt.js +336 -35
- package/dist/service/aiService.js +5 -0
- package/dist/service/fileUploadsGate.d.ts +8 -0
- package/dist/service/fileUploadsGate.js +18 -0
- package/dist/service/gemini.d.ts +3 -3
- package/dist/service/gemini.js +3 -3
- package/dist/service/vertex.d.ts +6 -6
- package/dist/service/vertex.js +5 -5
- package/dist/types/index.d.ts +29 -1
- package/package.json +4 -4
- package/src/aiApp.ts +13 -3
- package/src/models/aiRequest.test.ts +2 -2
- package/src/models/gptHistory.ts +17 -3
- package/src/routes/files.test.ts +21 -0
- package/src/routes/files.ts +2 -0
- package/src/routes/gpt.ts +421 -34
- package/src/routes/routes.test.ts +454 -3
- package/src/service/aiService.test.ts +21 -0
- package/src/service/aiService.ts +7 -0
- package/src/service/fileUploadsGate.ts +23 -0
- package/src/service/gemini.test.ts +16 -10
- package/src/service/gemini.ts +3 -3
- package/src/service/vertex.test.ts +49 -49
- package/src/service/vertex.ts +7 -8
- package/src/types/index.ts +30 -1
|
@@ -53,17 +53,17 @@ describe("vertex helpers", () => {
|
|
|
53
53
|
|
|
54
54
|
describe("normalizeVertexModelId", () => {
|
|
55
55
|
it("strips publisher resource prefixes", () => {
|
|
56
|
-
expect(normalizeVertexModelId("publishers/google/models/gemini-
|
|
57
|
-
"gemini-
|
|
56
|
+
expect(normalizeVertexModelId("publishers/google/models/gemini-3.8-flash")).toBe(
|
|
57
|
+
"gemini-3.8-flash"
|
|
58
58
|
);
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
it("strips version suffixes", () => {
|
|
62
|
-
expect(normalizeVertexModelId("gemini-
|
|
62
|
+
expect(normalizeVertexModelId("gemini-3.1-pro-preview@001")).toBe("gemini-3.1-pro-preview");
|
|
63
63
|
});
|
|
64
64
|
|
|
65
65
|
it("returns bare ids unchanged", () => {
|
|
66
|
-
expect(normalizeVertexModelId("gemini-
|
|
66
|
+
expect(normalizeVertexModelId("gemini-3.8-flash")).toBe("gemini-3.8-flash");
|
|
67
67
|
});
|
|
68
68
|
});
|
|
69
69
|
|
|
@@ -74,16 +74,16 @@ describe("vertex helpers", () => {
|
|
|
74
74
|
});
|
|
75
75
|
|
|
76
76
|
it("restricts to listed models when an allow-list is provided", () => {
|
|
77
|
-
expect(isVertexModelAllowed("gemini-
|
|
78
|
-
expect(isVertexModelAllowed("gemini-
|
|
77
|
+
expect(isVertexModelAllowed("gemini-3.8-flash", ["gemini-3.8-flash"])).toBe(true);
|
|
78
|
+
expect(isVertexModelAllowed("gemini-3.1-pro-preview", ["gemini-3.8-flash"])).toBe(false);
|
|
79
79
|
});
|
|
80
80
|
|
|
81
81
|
it("normalizes both the model id and allow-list entries before comparing", () => {
|
|
82
|
-
expect(isVertexModelAllowed("gemini-
|
|
82
|
+
expect(isVertexModelAllowed("gemini-3.8-flash", ["gemini-3.8-flash@001"])).toBe(true);
|
|
83
83
|
expect(
|
|
84
|
-
isVertexModelAllowed("publishers/google/models/gemini-
|
|
84
|
+
isVertexModelAllowed("publishers/google/models/gemini-3.8-flash", ["gemini-3.8-flash"])
|
|
85
85
|
).toBe(true);
|
|
86
|
-
expect(isVertexModelAllowed("gemini-
|
|
86
|
+
expect(isVertexModelAllowed("gemini-3.8-flash@001", ["gemini-3.1-pro-preview"])).toBe(false);
|
|
87
87
|
});
|
|
88
88
|
});
|
|
89
89
|
|
|
@@ -104,65 +104,65 @@ describe("vertex helpers", () => {
|
|
|
104
104
|
expect(provider?.languageModel("gemini-anything")).toBeDefined();
|
|
105
105
|
});
|
|
106
106
|
|
|
107
|
-
it("defaults location
|
|
107
|
+
it("defaults location to global", () => {
|
|
108
108
|
const withDefault = createVertexProvider({
|
|
109
109
|
project: "demo-project",
|
|
110
110
|
vertexFactory: makeVertexFactory(),
|
|
111
111
|
});
|
|
112
|
-
expect(withDefault?.location).toBe("
|
|
112
|
+
expect(withDefault?.location).toBe("global");
|
|
113
113
|
|
|
114
114
|
const withExplicit = createVertexProvider({
|
|
115
115
|
location: "europe-west1",
|
|
116
116
|
project: "demo-project",
|
|
117
117
|
vertexFactory: makeVertexFactory(),
|
|
118
118
|
});
|
|
119
|
-
expect(withExplicit?.location).toBe("
|
|
119
|
+
expect(withExplicit?.location).toBe("global");
|
|
120
120
|
});
|
|
121
121
|
|
|
122
122
|
it("enforces the allow-list when provided", () => {
|
|
123
123
|
const provider = createVertexProvider({
|
|
124
|
-
allowedModels: ["gemini-
|
|
124
|
+
allowedModels: ["gemini-3.8-flash"],
|
|
125
125
|
project: "demo-project",
|
|
126
126
|
vertexFactory: makeVertexFactory(),
|
|
127
127
|
});
|
|
128
|
-
expect(provider?.isModelAllowed("gemini-
|
|
129
|
-
expect(provider?.isModelAllowed("gemini-
|
|
130
|
-
expect(provider?.languageModel("gemini-
|
|
131
|
-
expect(() => provider?.languageModel("gemini-
|
|
128
|
+
expect(provider?.isModelAllowed("gemini-3.8-flash")).toBe(true);
|
|
129
|
+
expect(provider?.isModelAllowed("gemini-3.1-pro-preview")).toBe(false);
|
|
130
|
+
expect(provider?.languageModel("gemini-3.8-flash")).toBeDefined();
|
|
131
|
+
expect(() => provider?.languageModel("gemini-3.1-pro-preview")).toThrow();
|
|
132
132
|
expect(() => provider?.imageModel("imagen-4.0-fast-generate-001")).toThrow();
|
|
133
133
|
});
|
|
134
134
|
|
|
135
135
|
it("resolves versioned/path model ids against the allow-list", () => {
|
|
136
136
|
const provider = createVertexProvider({
|
|
137
|
-
allowedModels: ["gemini-
|
|
137
|
+
allowedModels: ["gemini-3.8-flash@001"],
|
|
138
138
|
project: "demo-project",
|
|
139
139
|
vertexFactory: makeVertexFactory(),
|
|
140
140
|
});
|
|
141
|
-
expect(provider?.isModelAllowed("gemini-
|
|
142
|
-
expect(provider?.languageModel("gemini-
|
|
141
|
+
expect(provider?.isModelAllowed("gemini-3.8-flash")).toBe(true);
|
|
142
|
+
expect(provider?.languageModel("gemini-3.8-flash")).toBeDefined();
|
|
143
143
|
});
|
|
144
144
|
});
|
|
145
145
|
|
|
146
146
|
describe("verifyVertexModelsEnabled", () => {
|
|
147
147
|
it("marks models available/unavailable based on the listing", async () => {
|
|
148
148
|
const result = await verifyVertexModelsEnabled({
|
|
149
|
-
listModelsFn: mock(async () => ["gemini-
|
|
150
|
-
models: ["gemini-
|
|
149
|
+
listModelsFn: mock(async () => ["gemini-3.8-flash", "gemini-3.5-flash-lite"]),
|
|
150
|
+
models: ["gemini-3.8-flash", "gemini-3.1-pro-preview"],
|
|
151
151
|
project: "demo-project",
|
|
152
152
|
});
|
|
153
153
|
expect(result.checked).toBe(true);
|
|
154
|
-
expect(result.available).toEqual(["gemini-
|
|
155
|
-
expect(result.unavailable).toEqual(["gemini-
|
|
154
|
+
expect(result.available).toEqual(["gemini-3.8-flash"]);
|
|
155
|
+
expect(result.unavailable).toEqual(["gemini-3.1-pro-preview"]);
|
|
156
156
|
});
|
|
157
157
|
|
|
158
158
|
it("returns checked=false when the listing is unavailable", async () => {
|
|
159
159
|
const result = await verifyVertexModelsEnabled({
|
|
160
160
|
listModelsFn: mock(async () => undefined),
|
|
161
|
-
models: ["gemini-
|
|
161
|
+
models: ["gemini-3.8-flash"],
|
|
162
162
|
project: "demo-project",
|
|
163
163
|
});
|
|
164
164
|
expect(result.checked).toBe(false);
|
|
165
|
-
expect(result.available).toEqual(["gemini-
|
|
165
|
+
expect(result.available).toEqual(["gemini-3.8-flash"]);
|
|
166
166
|
expect(result.unavailable).toEqual([]);
|
|
167
167
|
});
|
|
168
168
|
});
|
|
@@ -171,8 +171,8 @@ describe("vertex helpers", () => {
|
|
|
171
171
|
it("throws when a requested model is not enabled", async () => {
|
|
172
172
|
await expect(
|
|
173
173
|
assertVertexModelsEnabled({
|
|
174
|
-
listModelsFn: mock(async () => ["gemini-
|
|
175
|
-
models: ["gemini-
|
|
174
|
+
listModelsFn: mock(async () => ["gemini-3.8-flash"]),
|
|
175
|
+
models: ["gemini-3.1-pro-preview"],
|
|
176
176
|
project: "demo-project",
|
|
177
177
|
})
|
|
178
178
|
).rejects.toThrow();
|
|
@@ -181,7 +181,7 @@ describe("vertex helpers", () => {
|
|
|
181
181
|
it("does not throw when verification is inconclusive", async () => {
|
|
182
182
|
const result = await assertVertexModelsEnabled({
|
|
183
183
|
listModelsFn: mock(async () => undefined),
|
|
184
|
-
models: ["gemini-
|
|
184
|
+
models: ["gemini-3.1-pro-preview"],
|
|
185
185
|
project: "demo-project",
|
|
186
186
|
});
|
|
187
187
|
expect(result.checked).toBe(false);
|
|
@@ -203,10 +203,10 @@ describe("vertex helpers", () => {
|
|
|
203
203
|
const url = new URL(input.toString());
|
|
204
204
|
const isSecondPage = url.searchParams.get("pageToken") === "page-2";
|
|
205
205
|
const body = isSecondPage
|
|
206
|
-
? {publisherModels: [{name: "publishers/google/models/gemini-
|
|
206
|
+
? {publisherModels: [{name: "publishers/google/models/gemini-3.1-pro-preview"}]}
|
|
207
207
|
: {
|
|
208
208
|
nextPageToken: "page-2",
|
|
209
|
-
publisherModels: [{name: "publishers/google/models/gemini-
|
|
209
|
+
publisherModels: [{name: "publishers/google/models/gemini-3.8-flash"}],
|
|
210
210
|
};
|
|
211
211
|
return {
|
|
212
212
|
json: async () => body,
|
|
@@ -218,10 +218,10 @@ describe("vertex helpers", () => {
|
|
|
218
218
|
const models = await listEnabledVertexModels({
|
|
219
219
|
fetchImpl: fetchImpl as unknown as typeof fetch,
|
|
220
220
|
getAccessToken: async () => "fake-token",
|
|
221
|
-
location: "
|
|
221
|
+
location: "global",
|
|
222
222
|
project: "demo-project",
|
|
223
223
|
});
|
|
224
|
-
expect(models).toEqual(["gemini-
|
|
224
|
+
expect(models).toEqual(["gemini-3.8-flash", "gemini-3.1-pro-preview"]);
|
|
225
225
|
expect(fetchImpl).toHaveBeenCalledTimes(2);
|
|
226
226
|
});
|
|
227
227
|
|
|
@@ -239,7 +239,7 @@ describe("vertex helpers", () => {
|
|
|
239
239
|
return {
|
|
240
240
|
json: async () => ({
|
|
241
241
|
nextPageToken: "always-more",
|
|
242
|
-
publisherModels: [{name: "publishers/google/models/gemini-
|
|
242
|
+
publisherModels: [{name: "publishers/google/models/gemini-3.8-flash"}],
|
|
243
243
|
}),
|
|
244
244
|
ok: true,
|
|
245
245
|
status: 200,
|
|
@@ -329,10 +329,10 @@ describe("vertex helpers", () => {
|
|
|
329
329
|
const fetchImpl = mock(async () => ({
|
|
330
330
|
json: async () => ({
|
|
331
331
|
publisherModels: [
|
|
332
|
-
{name: "publishers/google/models/gemini-
|
|
332
|
+
{name: "publishers/google/models/gemini-3.8-flash"},
|
|
333
333
|
{},
|
|
334
334
|
{name: undefined},
|
|
335
|
-
{name: "publishers/google/models/gemini-
|
|
335
|
+
{name: "publishers/google/models/gemini-3.1-pro-preview"},
|
|
336
336
|
],
|
|
337
337
|
}),
|
|
338
338
|
ok: true,
|
|
@@ -343,17 +343,17 @@ describe("vertex helpers", () => {
|
|
|
343
343
|
getAccessToken: async () => "fake-token",
|
|
344
344
|
project: "demo-project",
|
|
345
345
|
});
|
|
346
|
-
expect(models).toEqual(["gemini-
|
|
346
|
+
expect(models).toEqual(["gemini-3.8-flash", "gemini-3.1-pro-preview"]);
|
|
347
347
|
});
|
|
348
348
|
|
|
349
|
-
it("uses global location
|
|
349
|
+
it("uses global location for Gemini 3 support", async () => {
|
|
350
350
|
process.env.GOOGLE_VERTEX_LOCATION = "europe-west4";
|
|
351
351
|
const fetchImpl = mock(async (input: string | URL) => {
|
|
352
352
|
const url = input.toString();
|
|
353
|
-
expect(url).toContain("
|
|
353
|
+
expect(url).toContain("aiplatform.googleapis.com");
|
|
354
354
|
return {
|
|
355
355
|
json: async () => ({
|
|
356
|
-
publisherModels: [{name: "publishers/google/models/gemini-
|
|
356
|
+
publisherModels: [{name: "publishers/google/models/gemini-3.8-flash"}],
|
|
357
357
|
}),
|
|
358
358
|
ok: true,
|
|
359
359
|
status: 200,
|
|
@@ -364,7 +364,7 @@ describe("vertex helpers", () => {
|
|
|
364
364
|
getAccessToken: async () => "fake-token",
|
|
365
365
|
project: "demo-project",
|
|
366
366
|
});
|
|
367
|
-
expect(models).toEqual(["gemini-
|
|
367
|
+
expect(models).toEqual(["gemini-3.8-flash"]);
|
|
368
368
|
});
|
|
369
369
|
});
|
|
370
370
|
|
|
@@ -378,13 +378,13 @@ describe("vertex helpers", () => {
|
|
|
378
378
|
expect(provider).toBeUndefined();
|
|
379
379
|
});
|
|
380
380
|
|
|
381
|
-
it("
|
|
381
|
+
it("forces global location for Gemini 3 support", () => {
|
|
382
382
|
process.env.GOOGLE_VERTEX_LOCATION = "asia-east1";
|
|
383
383
|
const provider = createVertexProvider({
|
|
384
384
|
project: "demo-project",
|
|
385
385
|
vertexFactory: makeVertexFactory(),
|
|
386
386
|
});
|
|
387
|
-
expect(provider?.location).toBe("
|
|
387
|
+
expect(provider?.location).toBe("global");
|
|
388
388
|
});
|
|
389
389
|
|
|
390
390
|
it("uses GOOGLE_VERTEX_PROJECT env when project option is omitted", () => {
|
|
@@ -417,12 +417,12 @@ describe("vertex helpers", () => {
|
|
|
417
417
|
describe("verifyVertexModelsEnabled", () => {
|
|
418
418
|
it("deduplicates requested models before checking", async () => {
|
|
419
419
|
const result = await verifyVertexModelsEnabled({
|
|
420
|
-
listModelsFn: mock(async () => ["gemini-
|
|
421
|
-
models: ["gemini-
|
|
420
|
+
listModelsFn: mock(async () => ["gemini-3.8-flash"]),
|
|
421
|
+
models: ["gemini-3.8-flash", "gemini-3.8-flash@001"],
|
|
422
422
|
project: "demo-project",
|
|
423
423
|
});
|
|
424
424
|
expect(result.checked).toBe(true);
|
|
425
|
-
expect(result.available).toEqual(["gemini-
|
|
425
|
+
expect(result.available).toEqual(["gemini-3.8-flash"]);
|
|
426
426
|
expect(result.unavailable).toEqual([]);
|
|
427
427
|
});
|
|
428
428
|
});
|
|
@@ -430,12 +430,12 @@ describe("vertex helpers", () => {
|
|
|
430
430
|
describe("assertVertexModelsEnabled", () => {
|
|
431
431
|
it("returns the result when all models are available", async () => {
|
|
432
432
|
const result = await assertVertexModelsEnabled({
|
|
433
|
-
listModelsFn: mock(async () => ["gemini-
|
|
434
|
-
models: ["gemini-
|
|
433
|
+
listModelsFn: mock(async () => ["gemini-3.8-flash", "gemini-3.1-pro-preview"]),
|
|
434
|
+
models: ["gemini-3.8-flash"],
|
|
435
435
|
project: "demo-project",
|
|
436
436
|
});
|
|
437
437
|
expect(result.checked).toBe(true);
|
|
438
|
-
expect(result.available).toEqual(["gemini-
|
|
438
|
+
expect(result.available).toEqual(["gemini-3.8-flash"]);
|
|
439
439
|
expect(result.unavailable).toEqual([]);
|
|
440
440
|
});
|
|
441
441
|
});
|
package/src/service/vertex.ts
CHANGED
|
@@ -15,8 +15,8 @@ import type {ImageModel, LanguageModel} from "ai";
|
|
|
15
15
|
* actually enabled/available for the project using the Google publisher-models listing API.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
/** Default Vertex / Gemini Enterprise Agent Platform region. */
|
|
19
|
-
export const DEFAULT_VERTEX_LOCATION = "
|
|
18
|
+
/** Default Vertex / Gemini Enterprise Agent Platform region. Only global is supported for Gemini 3. */
|
|
19
|
+
export const DEFAULT_VERTEX_LOCATION = "global";
|
|
20
20
|
|
|
21
21
|
const CLOUD_PLATFORM_SCOPE = "https://www.googleapis.com/auth/cloud-platform";
|
|
22
22
|
const MAX_MODEL_LIST_PAGES = 10;
|
|
@@ -38,7 +38,7 @@ export interface CreateVertexProviderOptions {
|
|
|
38
38
|
* Vertex models are permitted. When provided, only listed models may be resolved.
|
|
39
39
|
*/
|
|
40
40
|
allowedModels?: string[];
|
|
41
|
-
/** Vertex location/region.
|
|
41
|
+
/** Vertex location/region. Forced to global endpoint for Gemini 3 support. */
|
|
42
42
|
location?: string;
|
|
43
43
|
/** GCP project id. Falls back to the GOOGLE_VERTEX_PROJECT env var. */
|
|
44
44
|
project?: string;
|
|
@@ -76,7 +76,7 @@ export interface ListEnabledVertexModelsOptions {
|
|
|
76
76
|
fetchImpl?: typeof fetch;
|
|
77
77
|
/** Injectable access-token getter (defaults to Application Default Credentials). */
|
|
78
78
|
getAccessToken?: () => Promise<string | undefined>;
|
|
79
|
-
/** Vertex location/region.
|
|
79
|
+
/** Vertex location/region. Forced to global endpoint for Gemini 3 support. */
|
|
80
80
|
location?: string;
|
|
81
81
|
/** GCP project id. */
|
|
82
82
|
project: string;
|
|
@@ -99,8 +99,8 @@ export interface VerifyVertexModelsOptions extends ListEnabledVertexModelsOption
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
/**
|
|
102
|
-
* Normalize a publisher model resource name (e.g. "publishers/google/models/gemini-
|
|
103
|
-
* "gemini-
|
|
102
|
+
* Normalize a publisher model resource name (e.g. "publishers/google/models/gemini-3.8-flash" or
|
|
103
|
+
* "gemini-3.8-flash@001") down to its bare model id (e.g. "gemini-3.8-flash").
|
|
104
104
|
*/
|
|
105
105
|
export const normalizeVertexModelId = (modelName: string): string => {
|
|
106
106
|
const lastSegment = modelName.trim().split("/").pop() ?? modelName.trim();
|
|
@@ -152,8 +152,7 @@ const getDefaultAccessToken = async (): Promise<string | undefined> => {
|
|
|
152
152
|
}
|
|
153
153
|
};
|
|
154
154
|
|
|
155
|
-
const resolveLocation = (
|
|
156
|
-
location ?? process.env.GOOGLE_VERTEX_LOCATION ?? DEFAULT_VERTEX_LOCATION;
|
|
155
|
+
const resolveLocation = (_location?: string): string => "global";
|
|
157
156
|
|
|
158
157
|
const aiPlatformHost = (location: string): string =>
|
|
159
158
|
location === "global" ? "aiplatform.googleapis.com" : `${location}-aiplatform.googleapis.com`;
|
package/src/types/index.ts
CHANGED
|
@@ -81,6 +81,8 @@ export interface ImageContentPart {
|
|
|
81
81
|
type: "image";
|
|
82
82
|
url: string;
|
|
83
83
|
mimeType?: string;
|
|
84
|
+
/** Durable storage key when the attachment was uploaded through FileStorageService. */
|
|
85
|
+
gcsKey?: string;
|
|
84
86
|
}
|
|
85
87
|
|
|
86
88
|
export interface FileContentPart {
|
|
@@ -88,6 +90,8 @@ export interface FileContentPart {
|
|
|
88
90
|
url: string;
|
|
89
91
|
filename?: string;
|
|
90
92
|
mimeType: string;
|
|
93
|
+
/** Durable storage key when the attachment was uploaded through FileStorageService. */
|
|
94
|
+
gcsKey?: string;
|
|
91
95
|
}
|
|
92
96
|
|
|
93
97
|
export type MessageContentPart = TextContentPart | ImageContentPart | FileContentPart;
|
|
@@ -96,9 +100,16 @@ export type MessageContentPart = TextContentPart | ImageContentPart | FileConten
|
|
|
96
100
|
// GptHistory Types
|
|
97
101
|
// ============================================================
|
|
98
102
|
|
|
103
|
+
/** Lifecycle of an assistant reply that is persisted while it streams. */
|
|
104
|
+
export type GptHistoryPromptStatus = "streaming" | "complete" | "error";
|
|
105
|
+
|
|
99
106
|
export interface GptHistoryPrompt {
|
|
100
107
|
model?: string;
|
|
101
108
|
rating?: "up" | "down";
|
|
109
|
+
/** Set on assistant replies produced by /gpt/prompt. "streaming" while partial text is persisted. */
|
|
110
|
+
status?: GptHistoryPromptStatus;
|
|
111
|
+
/** Identifies one /gpt/prompt reply so resume clients can follow it. */
|
|
112
|
+
streamId?: string;
|
|
102
113
|
text: string;
|
|
103
114
|
type: "user" | "assistant" | "system" | "tool-call" | "tool-result";
|
|
104
115
|
content?: MessageContentPart[];
|
|
@@ -264,11 +275,24 @@ export interface GptRouteOptions {
|
|
|
264
275
|
tools?: Record<string, import("ai").Tool>;
|
|
265
276
|
toolChoice?: "auto" | "none" | "required";
|
|
266
277
|
maxSteps?: number;
|
|
267
|
-
/** Cheap model ID used for generating conversation titles (e.g. "gemini-
|
|
278
|
+
/** Cheap model ID used for generating conversation titles (e.g. "gemini-3.5-flash-lite"). Falls back to the main model if not set. */
|
|
268
279
|
titleModelId?: string;
|
|
269
280
|
/** Langfuse prompt name to load and use as the system prompt. Compiled with no variables.
|
|
270
281
|
* Falls back gracefully if Langfuse is not configured or the prompt is not found. */
|
|
271
282
|
langfuseSystemPromptName?: string;
|
|
283
|
+
/** When set, `data:` attachments are uploaded to durable storage and history stores the reference. */
|
|
284
|
+
fileStorageService?: import("../service/fileStorage").FileStorageService;
|
|
285
|
+
/**
|
|
286
|
+
* When `false` or the function returns `false`, prompts that include attachments are rejected.
|
|
287
|
+
* Omit or pass `true` to leave uploads enabled.
|
|
288
|
+
*/
|
|
289
|
+
fileUploadsEnabled?: import("../service/fileUploadsGate").FileUploadsEnabled;
|
|
290
|
+
/** How often partial assistant output is persisted while streaming. Defaults to 1000ms. */
|
|
291
|
+
streamPersistIntervalMs?: number;
|
|
292
|
+
/** How often the resume endpoint polls for new partial output. Defaults to 500ms. */
|
|
293
|
+
streamResumePollIntervalMs?: number;
|
|
294
|
+
/** A streaming reply with no persisted update for this long is treated as interrupted. Defaults to 60000ms. */
|
|
295
|
+
streamStaleAfterMs?: number;
|
|
272
296
|
}
|
|
273
297
|
|
|
274
298
|
export interface GptHistoryRouteOptions {
|
|
@@ -283,6 +307,11 @@ export interface FileRouteOptions {
|
|
|
283
307
|
gcsBucket: string;
|
|
284
308
|
maxFileSize?: number;
|
|
285
309
|
openApiOptions?: Record<string, unknown>;
|
|
310
|
+
/**
|
|
311
|
+
* When `false` or the function returns `false`, `POST /files/upload` is rejected.
|
|
312
|
+
* Reads and deletes stay available. Omit or pass `true` to leave uploads enabled.
|
|
313
|
+
*/
|
|
314
|
+
fileUploadsEnabled?: import("../service/fileUploadsGate").FileUploadsEnabled;
|
|
286
315
|
}
|
|
287
316
|
|
|
288
317
|
export interface McpRouteOptions {
|