@aalis/plugin-embedding-openai 0.13.0 → 0.14.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/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -12
- package/dist/index.js.map +1 -1
- package/dist/locales/en.d.ts +13 -0
- package/dist/locales/en.d.ts.map +1 -0
- package/dist/locales/en.js +13 -0
- package/dist/locales/en.js.map +1 -0
- package/dist/texts.d.ts +25 -0
- package/dist/texts.d.ts.map +1 -0
- package/dist/texts.js +21 -0
- package/dist/texts.js.map +1 -0
- package/package.json +11 -5
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ declare const _default: import("@aalis/core").PluginDefinition<{
|
|
|
3
3
|
logger: import("@aalis/core").ServiceDescriptor<(identity: symbol) => import("@aalis/core").Logger, import("@aalis/core").Logger>;
|
|
4
4
|
lifecycle: import("@aalis/core").ServiceDescriptor<(identity: symbol) => import("@aalis/core").LifecycleCap, import("@aalis/core").LifecycleCap>;
|
|
5
5
|
provide: import("@aalis/core").ServiceDescriptor<(identity: symbol) => import("@aalis/core").Provide, import("@aalis/core").Provide>;
|
|
6
|
+
contributions: import("@aalis/core").OptionalUse<import("@aalis/api-contributions").ContributionRegistry, import("@aalis/api-contributions").Contributions>;
|
|
6
7
|
}>;
|
|
7
8
|
export default _default;
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;AAiGA,wBAsCG"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { contributions } from '@aalis/api-contributions';
|
|
1
2
|
import { embedding } from '@aalis/api-embedding';
|
|
2
|
-
import { config, definePlugin, lifecycle, logger, provide } from '@aalis/core';
|
|
3
|
+
import { config, definePlugin, lifecycle, logger, optional, provide } from '@aalis/core';
|
|
3
4
|
import { configError, defineConfig, parseConfig } from '@aalis/schema-config';
|
|
5
|
+
import { t } from './texts.js';
|
|
4
6
|
// ===== 配置 =====
|
|
5
7
|
const configSchema = defineConfig({
|
|
6
8
|
apiKey: {
|
|
@@ -9,27 +11,27 @@ const configSchema = defineConfig({
|
|
|
9
11
|
required: true,
|
|
10
12
|
secret: true,
|
|
11
13
|
onInvalid: 'error',
|
|
12
|
-
description: '
|
|
14
|
+
description: t('apiKeyDescription'),
|
|
13
15
|
},
|
|
14
16
|
baseUrl: {
|
|
15
17
|
type: 'string',
|
|
16
|
-
label: '
|
|
18
|
+
label: t('baseUrlLabel'),
|
|
17
19
|
default: 'https://api.openai.com/v1',
|
|
18
20
|
onInvalid: 'error',
|
|
19
|
-
description: '
|
|
21
|
+
description: t('baseUrlDescription'),
|
|
20
22
|
},
|
|
21
23
|
model: {
|
|
22
24
|
type: 'select',
|
|
23
|
-
label: '
|
|
25
|
+
label: t('modelLabel'),
|
|
24
26
|
default: 'text-embedding-3-small',
|
|
25
|
-
dynamicOptions: 'embedding',
|
|
26
|
-
description: '
|
|
27
|
+
dynamicOptions: 'embedding-openai',
|
|
28
|
+
description: t('modelDescription'),
|
|
27
29
|
},
|
|
28
30
|
timeoutMs: {
|
|
29
31
|
type: 'number',
|
|
30
|
-
label: '
|
|
32
|
+
label: t('timeoutMsLabel'),
|
|
31
33
|
default: 30000,
|
|
32
|
-
description: '
|
|
34
|
+
description: t('timeoutMsDescription'),
|
|
33
35
|
},
|
|
34
36
|
});
|
|
35
37
|
// ===== 服务实现 =====
|
|
@@ -67,6 +69,7 @@ class OpenAIEmbeddingService {
|
|
|
67
69
|
const data = (await res.json());
|
|
68
70
|
return data.data[0].embedding;
|
|
69
71
|
}
|
|
72
|
+
/** 这个端点的全部模型:本插件的可选项来源 embedding-openai 用它 */
|
|
70
73
|
async listModels() {
|
|
71
74
|
try {
|
|
72
75
|
const res = await fetch(`${this.baseUrl}/models`, {
|
|
@@ -91,11 +94,16 @@ export default definePlugin({
|
|
|
91
94
|
configSchema,
|
|
92
95
|
reusable: true,
|
|
93
96
|
provides: [embedding],
|
|
94
|
-
|
|
95
|
-
|
|
97
|
+
/** contributions 交「Embedding 模型」下拉的可选项来源,缺席时下拉没有可选项 */
|
|
98
|
+
uses: { config, logger, lifecycle, provide, contributions: optional(contributions) },
|
|
99
|
+
async apply({ config, logger, lifecycle, provide, contributions }) {
|
|
96
100
|
const cfg = parseConfig(configSchema, config.use, logger.use);
|
|
97
101
|
if (!URL.canParse(cfg.baseUrl) || new URL(cfg.baseUrl).username || new URL(cfg.baseUrl).password) {
|
|
98
|
-
throw configError('
|
|
102
|
+
throw configError(t('baseUrlInvalid'));
|
|
103
|
+
}
|
|
104
|
+
// 插件在 baseUrl 后面拼路径,带查询串或片段(含末尾单个 ?)时拼出来的地址是坏的,所以按原文判
|
|
105
|
+
if (/[?#]/.test(cfg.baseUrl)) {
|
|
106
|
+
throw configError(t('baseUrlQuery'));
|
|
99
107
|
}
|
|
100
108
|
const service = new OpenAIEmbeddingService(cfg.baseUrl, cfg.model, cfg.apiKey, cfg.timeoutMs);
|
|
101
109
|
// 启动时检查连通性(失败不阻塞,只警告);停用或停机时中止
|
|
@@ -109,6 +117,12 @@ export default definePlugin({
|
|
|
109
117
|
logger.use.warn(`OpenAI Embedding 连通性检查失败 (${cfg.baseUrl}, model=${cfg.model}): ${msg},服务仍将注册`);
|
|
110
118
|
}
|
|
111
119
|
provide.use(embedding, service, { label: `OpenAI / ${cfg.model}` });
|
|
120
|
+
// 「Embedding 模型」下拉只列这个插件连着的端点的模型(按服务名合起各提供者会混进别家的);来源名按插件定,开了几个实例时
|
|
121
|
+
// WebUI 取最前那家
|
|
122
|
+
contributions.use.contribute('webui:options', {
|
|
123
|
+
id: 'embedding-openai',
|
|
124
|
+
list: async () => (await service.listModels()).map(id => ({ value: id, label: id })),
|
|
125
|
+
});
|
|
112
126
|
},
|
|
113
127
|
});
|
|
114
128
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuD,SAAS,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAuD,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtG,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACzF,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,CAAC,EAAE,MAAM,YAAY,CAAC;AAE/B,iBAAiB;AAEjB,MAAM,YAAY,GAAG,YAAY,CAAC;IAChC,MAAM,EAAE;QACN,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,IAAI;QACZ,SAAS,EAAE,OAAO;QAClB,WAAW,EAAE,CAAC,CAAC,mBAAmB,CAAC;KACpC;IACD,OAAO,EAAE;QACP,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,CAAC,CAAC,cAAc,CAAC;QACxB,OAAO,EAAE,2BAA2B;QACpC,SAAS,EAAE,OAAO;QAClB,WAAW,EAAE,CAAC,CAAC,oBAAoB,CAAC;KACrC;IACD,KAAK,EAAE;QACL,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,CAAC,CAAC,YAAY,CAAC;QACtB,OAAO,EAAE,wBAAwB;QACjC,cAAc,EAAE,kB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,CAAC,OAAO,EAAE,CAAC,CAAC;QACzE,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC;YACtC,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC7D,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,6BAA6B,GAAG,CAAC,OAAO,WAAW,GAAG,CAAC,KAAK,MAAM,GAAG,SAAS,CAAC,CAAC;QAClG,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,YAAY,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACpE,mEAAmE;QACnE,cAAc;QACd,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,eAAe,EAAE;YAC5C,EAAE,EAAE,kBAAkB;YACtB,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;SACrF,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
readonly apiKeyDescription: "OpenAI API key";
|
|
3
|
+
readonly baseUrlLabel: "API URL";
|
|
4
|
+
readonly baseUrlDescription: "Full prefix of the API endpoint (including the version segment); the plugin only appends /embeddings and /models to it";
|
|
5
|
+
readonly modelLabel: "Embedding model";
|
|
6
|
+
readonly modelDescription: "The model used to turn text into vectors";
|
|
7
|
+
readonly timeoutMsLabel: "Request timeout (ms)";
|
|
8
|
+
readonly timeoutMsDescription: "Timeout of a single embedding request. Without a limit, the startup probe can hold up the whole plugin activation chain.";
|
|
9
|
+
readonly baseUrlInvalid: "baseUrl must be a full URL without a user name or password";
|
|
10
|
+
readonly baseUrlQuery: "baseUrl cannot contain a query string or fragment (anything after ? or #): the plugin appends paths to it";
|
|
11
|
+
};
|
|
12
|
+
export default _default;
|
|
13
|
+
//# sourceMappingURL=en.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/locales/en.ts"],"names":[],"mappings":";;;;;;;;;;;AAGA,wBAaG"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineLocale } from '@aalis/schema-i18n';
|
|
2
|
+
export default defineLocale()({
|
|
3
|
+
apiKeyDescription: 'OpenAI API key',
|
|
4
|
+
baseUrlLabel: 'API URL',
|
|
5
|
+
baseUrlDescription: 'Full prefix of the API endpoint (including the version segment); the plugin only appends /embeddings and /models to it',
|
|
6
|
+
modelLabel: 'Embedding model',
|
|
7
|
+
modelDescription: 'The model used to turn text into vectors',
|
|
8
|
+
timeoutMsLabel: 'Request timeout (ms)',
|
|
9
|
+
timeoutMsDescription: 'Timeout of a single embedding request. Without a limit, the startup probe can hold up the whole plugin activation chain.',
|
|
10
|
+
baseUrlInvalid: 'baseUrl must be a full URL without a user name or password',
|
|
11
|
+
baseUrlQuery: 'baseUrl cannot contain a query string or fragment (anything after ? or #): the plugin appends paths to it',
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=en.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en.js","sourceRoot":"","sources":["../../src/locales/en.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,eAAe,YAAY,EAAU,CAAC;IACpC,iBAAiB,EAAE,gBAAgB;IACnC,YAAY,EAAE,SAAS;IACvB,kBAAkB,EAChB,wHAAwH;IAC1H,UAAU,EAAE,iBAAiB;IAC7B,gBAAgB,EAAE,0CAA0C;IAC5D,cAAc,EAAE,sBAAsB;IACtC,oBAAoB,EAClB,0HAA0H;IAC5H,cAAc,EAAE,4DAA4D;IAC5E,YAAY,EACV,2GAA2G;CAC9G,CAAC,CAAC"}
|
package/dist/texts.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare const SOURCE: {
|
|
2
|
+
readonly apiKeyDescription: "OpenAI API 密钥";
|
|
3
|
+
readonly baseUrlLabel: "API 地址";
|
|
4
|
+
readonly baseUrlDescription: "API 端点完整前缀(含版本段);插件只在其后拼 /embeddings 与 /models";
|
|
5
|
+
readonly modelLabel: "Embedding 模型";
|
|
6
|
+
readonly modelDescription: "用于生成文本向量的模型";
|
|
7
|
+
readonly timeoutMsLabel: "请求超时 (ms)";
|
|
8
|
+
readonly timeoutMsDescription: "单次 embedding 请求超时时间。不设上限时启动探测会把插件激活链整条钉住。";
|
|
9
|
+
readonly baseUrlInvalid: "baseUrl 需为不带用户名或密码的完整 URL";
|
|
10
|
+
readonly baseUrlQuery: "baseUrl 不能带查询串或片段(? 或 # 之后的部分):插件在它后面拼接路径";
|
|
11
|
+
};
|
|
12
|
+
export type Source = typeof SOURCE;
|
|
13
|
+
export declare const t: import("@aalis/schema-i18n").TextFactory<{
|
|
14
|
+
readonly apiKeyDescription: "OpenAI API 密钥";
|
|
15
|
+
readonly baseUrlLabel: "API 地址";
|
|
16
|
+
readonly baseUrlDescription: "API 端点完整前缀(含版本段);插件只在其后拼 /embeddings 与 /models";
|
|
17
|
+
readonly modelLabel: "Embedding 模型";
|
|
18
|
+
readonly modelDescription: "用于生成文本向量的模型";
|
|
19
|
+
readonly timeoutMsLabel: "请求超时 (ms)";
|
|
20
|
+
readonly timeoutMsDescription: "单次 embedding 请求超时时间。不设上限时启动探测会把插件激活链整条钉住。";
|
|
21
|
+
readonly baseUrlInvalid: "baseUrl 需为不带用户名或密码的完整 URL";
|
|
22
|
+
readonly baseUrlQuery: "baseUrl 不能带查询串或片段(? 或 # 之后的部分):插件在它后面拼接路径";
|
|
23
|
+
}>;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=texts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"texts.d.ts","sourceRoot":"","sources":["../src/texts.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,MAAM;;;;;;;;;;CAUF,CAAC;AACX,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC;AAEnC,eAAO,MAAM,CAAC;;;;;;;;;;EAKZ,CAAC"}
|
package/dist/texts.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// 本插件自己的原文字典:配置项与配置报错
|
|
2
|
+
import { defineTexts } from '@aalis/schema-i18n';
|
|
3
|
+
import en from './locales/en.js';
|
|
4
|
+
const SOURCE = {
|
|
5
|
+
apiKeyDescription: 'OpenAI API 密钥',
|
|
6
|
+
baseUrlLabel: 'API 地址',
|
|
7
|
+
baseUrlDescription: 'API 端点完整前缀(含版本段);插件只在其后拼 /embeddings 与 /models',
|
|
8
|
+
modelLabel: 'Embedding 模型',
|
|
9
|
+
modelDescription: '用于生成文本向量的模型',
|
|
10
|
+
timeoutMsLabel: '请求超时 (ms)',
|
|
11
|
+
timeoutMsDescription: '单次 embedding 请求超时时间。不设上限时启动探测会把插件激活链整条钉住。',
|
|
12
|
+
baseUrlInvalid: 'baseUrl 需为不带用户名或密码的完整 URL',
|
|
13
|
+
baseUrlQuery: 'baseUrl 不能带查询串或片段(? 或 # 之后的部分):插件在它后面拼接路径',
|
|
14
|
+
};
|
|
15
|
+
export const t = defineTexts({
|
|
16
|
+
ns: '@aalis/plugin-embedding-openai',
|
|
17
|
+
language: 'zh-CN',
|
|
18
|
+
source: SOURCE,
|
|
19
|
+
locales: { en },
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=texts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"texts.js","sourceRoot":"","sources":["../src/texts.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAEjC,MAAM,MAAM,GAAG;IACb,iBAAiB,EAAE,eAAe;IAClC,YAAY,EAAE,QAAQ;IACtB,kBAAkB,EAAE,gDAAgD;IACpE,UAAU,EAAE,cAAc;IAC1B,gBAAgB,EAAE,aAAa;IAC/B,cAAc,EAAE,WAAW;IAC3B,oBAAoB,EAAE,2CAA2C;IACjE,cAAc,EAAE,2BAA2B;IAC3C,YAAY,EAAE,2CAA2C;CACjD,CAAC;AAGX,MAAM,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC;IAC3B,EAAE,EAAE,gCAAgC;IACpC,QAAQ,EAAE,OAAO;IACjB,MAAM,EAAE,MAAM;IACd,OAAO,EAAE,EAAE,EAAE,EAAE;CAChB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aalis/plugin-embedding-openai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/node": "^22.0.0",
|
|
28
28
|
"typescript": "^5.7.0",
|
|
29
|
-
"@aalis/core": "0.
|
|
29
|
+
"@aalis/core": "0.21.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@aalis/core": ">=0.
|
|
32
|
+
"@aalis/core": ">=0.21.0 <1.0.0"
|
|
33
33
|
},
|
|
34
34
|
"aalis": {
|
|
35
35
|
"service": {
|
|
@@ -41,12 +41,18 @@
|
|
|
41
41
|
"lifecycle",
|
|
42
42
|
"logger",
|
|
43
43
|
"provide"
|
|
44
|
+
],
|
|
45
|
+
"optional": [
|
|
46
|
+
"contributions"
|
|
44
47
|
]
|
|
45
48
|
}
|
|
46
49
|
},
|
|
47
50
|
"dependencies": {
|
|
48
|
-
"@aalis/api-embedding": ">=0.
|
|
49
|
-
"@aalis/schema-config": ">=0.
|
|
51
|
+
"@aalis/api-embedding": ">=0.9.0 <1.0.0",
|
|
52
|
+
"@aalis/schema-config": ">=0.16.0 <1.0.0",
|
|
53
|
+
"@aalis/api-contributions": ">=0.2.0 <1.0.0",
|
|
54
|
+
"@aalis/api-webui": ">=0.13.0 <1.0.0",
|
|
55
|
+
"@aalis/schema-i18n": ">=0.1.0 <1.0.0"
|
|
50
56
|
},
|
|
51
57
|
"scripts": {
|
|
52
58
|
"build": "tsc",
|