temp
This commit is contained in:
		@@ -1,6 +1,6 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "name": "@kevisual/ai",
 | 
					  "name": "@kevisual/ai",
 | 
				
			||||||
  "version": "0.0.4",
 | 
					  "version": "0.0.5",
 | 
				
			||||||
  "description": "后面需要把ai-center的provider模块提取出去",
 | 
					  "description": "后面需要把ai-center的provider模块提取出去",
 | 
				
			||||||
  "main": "index.js",
 | 
					  "main": "index.js",
 | 
				
			||||||
  "basename": "/root/ai-center-services",
 | 
					  "basename": "/root/ai-center-services",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,3 +1,5 @@
 | 
				
			|||||||
export * from './chat.ts';
 | 
					export * from './chat.ts';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export * from './knowledge.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 AES from 'crypto-js/aes.js';
 | 
				
			||||||
import Utf8 from 'crypto-js/enc-utf8.js';
 | 
					import Utf8 from 'crypto-js/enc-utf8.js';
 | 
				
			||||||
 | 
					import type { AIConfig } from './ai-config-type.js';
 | 
				
			||||||
const CryptoJS = { AES, enc: { Utf8 } };
 | 
					const CryptoJS = { AES, enc: { Utf8 } };
 | 
				
			||||||
// 加密函数
 | 
					// 加密函数
 | 
				
			||||||
export function encryptAES(plainText: string, secretKey: string) {
 | 
					export function encryptAES(plainText: string, secretKey: string) {
 | 
				
			||||||
@@ -71,19 +70,6 @@ export type ProviderResult = {
 | 
				
			|||||||
  decryptKey?: string;
 | 
					  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 {
 | 
					export class AIConfigParser {
 | 
				
			||||||
  private config: AIConfig;
 | 
					  private config: AIConfig;
 | 
				
			||||||
  result: ProviderResult;
 | 
					  result: ProviderResult;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user