diff --git a/package.json b/package.json index 5303436..8011c97 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kevisual/ai", - "version": "0.0.4", + "version": "0.0.5", "description": "后面需要把ai-center的provider模块提取出去", "main": "index.js", "basename": "/root/ai-center-services", diff --git a/src/provider/index.ts b/src/provider/index.ts index 7873f1f..0c03e4d 100644 --- a/src/provider/index.ts +++ b/src/provider/index.ts @@ -1,3 +1,5 @@ export * from './chat.ts'; -export * from './knowledge.ts'; \ No newline at end of file +export * from './knowledge.ts'; + +export * from './utils/index.ts'; diff --git a/src/provider/utils/index.ts b/src/provider/utils/index.ts new file mode 100644 index 0000000..626238c --- /dev/null +++ b/src/provider/utils/index.ts @@ -0,0 +1,2 @@ +export * from './ai-config-type.ts'; +export * from './parse-config.ts'; diff --git a/src/provider/utils/parse-config.ts b/src/provider/utils/parse-config.ts index b8d02a5..cb4df60 100644 --- a/src/provider/utils/parse-config.ts +++ b/src/provider/utils/parse-config.ts @@ -1,7 +1,6 @@ -import { Permission } from '@kevisual/permission'; import AES from 'crypto-js/aes.js'; import Utf8 from 'crypto-js/enc-utf8.js'; - +import type { AIConfig } from './ai-config-type.js'; const CryptoJS = { AES, enc: { Utf8 } }; // 加密函数 export function encryptAES(plainText: string, secretKey: string) { @@ -71,19 +70,6 @@ export type ProviderResult = { decryptKey?: string; }; -export type AIConfig = { - title?: string; - description?: string; - models: AIModel[]; - secretKeys: SecretKey[]; - permission?: Permission; - filter?: { - objectKey: string; - type: 'array' | 'object'; - operate: 'removeAttribute' | 'remove'; - attribute: string[]; - }[]; -}; export class AIConfigParser { private config: AIConfig; result: ProviderResult;