This commit is contained in:
熊潇 2025-05-28 19:39:42 +08:00
parent 3763e5da63
commit 3cd3be6024
4 changed files with 7 additions and 17 deletions

View File

@ -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",

View File

@ -1,3 +1,5 @@
export * from './chat.ts';
export * from './knowledge.ts';
export * from './utils/index.ts';

View File

@ -0,0 +1,2 @@
export * from './ai-config-type.ts';
export * from './parse-config.ts';

View File

@ -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;