@tstdl/base 0.92.38 → 0.92.40
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/ai/ai.service.js +5 -3
- package/package.json +5 -5
package/ai/ai.service.js
CHANGED
|
@@ -202,17 +202,19 @@ Always output the content and tags in ${options?.targetLanguage ?? 'the same lan
|
|
|
202
202
|
responseSchema: isDefined(request.generationSchema) ? convertToOpenApiSchema(request.generationSchema) : undefined,
|
|
203
203
|
frequencyPenalty: request.generationOptions?.frequencyPenalty
|
|
204
204
|
};
|
|
205
|
+
const model = request.model ?? this.defaultModel;
|
|
206
|
+
const maxModelTokens = model.includes('thinking') ? 65536 : 8192;
|
|
207
|
+
const maxTotalOutputTokens = request.generationOptions?.maxOutputTokens ?? maxModelTokens;
|
|
205
208
|
const inputContent = this.convertContents(request.contents);
|
|
206
|
-
const maxTotalOutputTokens = request.generationOptions?.maxOutputTokens ?? 8192;
|
|
207
209
|
let iterations = 0;
|
|
208
210
|
let totalPromptTokens = 0;
|
|
209
211
|
let totalOutputTokens = 0;
|
|
210
212
|
let totalTokens = 0;
|
|
211
213
|
while (totalOutputTokens < maxTotalOutputTokens) {
|
|
212
|
-
const generation = await this.getModel(
|
|
214
|
+
const generation = await this.getModel(model).generateContentStream({
|
|
213
215
|
generationConfig: {
|
|
214
216
|
...generationConfig,
|
|
215
|
-
maxOutputTokens: Math.min(
|
|
217
|
+
maxOutputTokens: Math.min(maxModelTokens, maxTotalOutputTokens - totalOutputTokens)
|
|
216
218
|
},
|
|
217
219
|
systemInstruction: request.systemInstruction,
|
|
218
220
|
tools: (isDefined(googleFunctionDeclarations) && (googleFunctionDeclarations.length > 0)) ? [{ functionDeclarations: googleFunctionDeclarations }] : undefined,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tstdl/base",
|
|
3
|
-
"version": "0.92.
|
|
3
|
+
"version": "0.92.40",
|
|
4
4
|
"author": "Patrick Hein",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"./reflection": "./reflection/index.js",
|
|
86
86
|
"./rpc": "./rpc/index.js",
|
|
87
87
|
"./rpc/endpoints": "./rpc/endpoints/index.js",
|
|
88
|
-
"./rxjs": "./rxjs-utils/index.js",
|
|
88
|
+
"./rxjs-utils": "./rxjs-utils/index.js",
|
|
89
89
|
"./schema": "./schema/index.js",
|
|
90
90
|
"./schema/converters": "./schema/converters/index.js",
|
|
91
91
|
"./search-index": "./search-index/index.js",
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
},
|
|
129
129
|
"devDependencies": {
|
|
130
130
|
"@mxssfd/typedoc-theme": "1.1",
|
|
131
|
-
"@stylistic/eslint-plugin": "
|
|
131
|
+
"@stylistic/eslint-plugin": "3.0",
|
|
132
132
|
"@types/chroma-js": "2.4",
|
|
133
133
|
"@types/koa__router": "12.0",
|
|
134
134
|
"@types/luxon": "3.4",
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
"@types/node": "22",
|
|
138
138
|
"@types/nodemailer": "6.4",
|
|
139
139
|
"@types/pg": "8.11",
|
|
140
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
140
|
+
"@typescript-eslint/eslint-plugin": "8.22",
|
|
141
141
|
"concurrently": "9.1",
|
|
142
142
|
"drizzle-kit": "0.30",
|
|
143
143
|
"eslint": "8.57",
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
"@zxcvbn-ts/language-de": "^3.0",
|
|
160
160
|
"@zxcvbn-ts/language-en": "^3.0",
|
|
161
161
|
"chroma-js": "^2.6",
|
|
162
|
-
"drizzle-orm": "^0.
|
|
162
|
+
"drizzle-orm": "^0.39",
|
|
163
163
|
"handlebars": "^4.7",
|
|
164
164
|
"koa": "^2.15",
|
|
165
165
|
"minio": "^8.0",
|