@adminforth/i18n 2.0.12 → 2.0.13
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/dist/index.js +7 -8
- package/index.ts +1 -3
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -459,14 +459,13 @@ export default class I18nPlugin extends AdminForthPlugin {
|
|
|
459
459
|
const jsonSchemaRequired = strings.map(s => s.en_string);
|
|
460
460
|
const dedupRequired = Array.from(new Set(jsonSchemaRequired));
|
|
461
461
|
// call OpenAI
|
|
462
|
-
const resp = yield this.options.completeAdapter.complete(prompt,
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
},
|
|
462
|
+
const resp = yield this.options.completeAdapter.complete(prompt, prompt.length * 2, {
|
|
463
|
+
name: "translation_response",
|
|
464
|
+
schema: {
|
|
465
|
+
type: "object",
|
|
466
|
+
properties: jsonSchemaProperties,
|
|
467
|
+
required: dedupRequired,
|
|
468
|
+
additionalProperties: false,
|
|
470
469
|
},
|
|
471
470
|
});
|
|
472
471
|
process.env.HEAVY_DEBUG && console.log(`🪲🔪LLM resp >> ${prompt.length}, <<${resp.content.length} :\n\n`, JSON.stringify(resp));
|
package/index.ts
CHANGED
|
@@ -538,17 +538,15 @@ export default class I18nPlugin extends AdminForthPlugin {
|
|
|
538
538
|
// call OpenAI
|
|
539
539
|
const resp = await this.options.completeAdapter.complete(
|
|
540
540
|
prompt,
|
|
541
|
-
[],
|
|
542
541
|
prompt.length * 2,
|
|
543
542
|
{
|
|
544
|
-
json_schema: {
|
|
545
543
|
name: "translation_response",
|
|
546
544
|
schema: {
|
|
547
545
|
type: "object",
|
|
548
546
|
properties: jsonSchemaProperties,
|
|
549
547
|
required: dedupRequired,
|
|
548
|
+
additionalProperties: false,
|
|
550
549
|
},
|
|
551
|
-
},
|
|
552
550
|
}
|
|
553
551
|
);
|
|
554
552
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adminforth/i18n",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.13",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -38,10 +38,11 @@
|
|
|
38
38
|
"p-limit": "^7.3.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"adminforth": "^2.
|
|
41
|
+
"adminforth": "^2.35.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/node": "^22.10.7",
|
|
45
|
+
"adminforth": "^2.35.0",
|
|
45
46
|
"i18n-iso-countries": "^7.13.0",
|
|
46
47
|
"semantic-release": "^24.2.1",
|
|
47
48
|
"semantic-release-slack-bot": "^4.0.2",
|