temp
This commit is contained in:
		@@ -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",
 | 
			
		||||
 
 | 
			
		||||
@@ -1,3 +1,5 @@
 | 
			
		||||
export * from './chat.ts';
 | 
			
		||||
 | 
			
		||||
export * from './knowledge.ts';
 | 
			
		||||
 | 
			
		||||
export * from './utils/index.ts';
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								src/provider/utils/index.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								src/provider/utils/index.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,2 @@
 | 
			
		||||
export * from './ai-config-type.ts';
 | 
			
		||||
export * from './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;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user