@kevisual/ai 0.0.26 → 0.0.27

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.
@@ -1,5 +1,3 @@
1
- import * as _kevisual_permission from '@kevisual/permission';
2
- import { Permission } from '@kevisual/permission';
3
1
  import { Result } from '@kevisual/query';
4
2
 
5
3
  type ChatMessage = {
@@ -609,141 +607,5 @@ type RerankOptions = {
609
607
  overlap_tokens?: number;
610
608
  };
611
609
 
612
- type AIModel = {
613
- /**
614
- * 提供商
615
- */
616
- provider: string;
617
- /**
618
- * 模型名称
619
- */
620
- model: string;
621
- /**
622
- * 模型组
623
- */
624
- group: string;
625
- /**
626
- * 每日请求频率限制
627
- */
628
- dayLimit?: number;
629
- /**
630
- * 总的token限制
631
- */
632
- tokenLimit?: number;
633
- };
634
- type SecretKey = {
635
- /**
636
- * 组
637
- */
638
- group: string;
639
- /**
640
- * API密钥
641
- */
642
- apiKey: string;
643
- /**
644
- * 解密密钥
645
- */
646
- decryptKey?: string;
647
- };
648
- type AIConfig = {
649
- title?: string;
650
- description?: string;
651
- models: AIModel[];
652
- secretKeys: SecretKey[];
653
- permission?: Permission;
654
- filter?: {
655
- objectKey: string;
656
- type: 'array' | 'object';
657
- operate: 'removeAttribute' | 'remove';
658
- attribute: string[];
659
- }[];
660
- };
661
-
662
- declare function encryptAES(plainText: string, secretKey: string): string;
663
- declare function decryptAES(cipherText: string, secretKey: string): string;
664
- type GetProviderOpts = {
665
- model: string;
666
- group: string;
667
- decryptKey?: string;
668
- };
669
- type ProviderResult = {
670
- provider: string;
671
- model: string;
672
- group: string;
673
- apiKey: string;
674
- dayLimit?: number;
675
- tokenLimit?: number;
676
- baseURL?: string;
677
- /**
678
- * 解密密钥
679
- */
680
- decryptKey?: string;
681
- };
682
- declare class AIConfigParser {
683
- private config;
684
- result: ProviderResult;
685
- constructor(config: AIConfig);
686
- /**
687
- * 获取模型配置
688
- * @param opts
689
- * @returns
690
- */
691
- getProvider(opts: GetProviderOpts): ProviderResult;
692
- /**
693
- * 获取解密密钥
694
- * @param opts
695
- * @returns
696
- */
697
- getSecretKey(opts?: {
698
- getCache?: (key: string) => Promise<string>;
699
- setCache?: (key: string, value: string) => Promise<void>;
700
- providerResult?: ProviderResult;
701
- }): Promise<string>;
702
- /**
703
- * 加密
704
- * @param plainText
705
- * @param secretKey
706
- * @returns
707
- */
708
- encrypt(plainText: string, secretKey: string): string;
709
- /**
710
- * 解密
711
- * @param cipherText
712
- * @param secretKey
713
- * @returns
714
- */
715
- decrypt(cipherText: string, secretKey: string): string;
716
- /**
717
- * 获取模型配置
718
- * @returns
719
- */
720
- getSelectOpts(): {
721
- group: string;
722
- apiKey: string;
723
- decryptKey?: string;
724
- provider: string;
725
- model: string;
726
- dayLimit?: number;
727
- tokenLimit?: number;
728
- }[];
729
- getConfig(keepSecret?: boolean, config?: AIConfig): AIConfig | {
730
- secretKeys: {
731
- apiKey: any;
732
- decryptKey: any;
733
- group: string;
734
- }[];
735
- title?: string;
736
- description?: string;
737
- models?: AIModel[];
738
- permission?: _kevisual_permission.Permission;
739
- filter?: {
740
- objectKey: string;
741
- type: "array" | "object";
742
- operate: "removeAttribute" | "remove";
743
- attribute: string[];
744
- }[];
745
- };
746
- }
747
-
748
- export { AIConfigParser, AIUtils, BailianChat, BailianProvider, BaseChat, CNBChat, ChatProviderMap, Custom, CustomProvider, DeepSeek, DeepSeekProvider, Kevisual, KevisualProvider, Kimi, KimiProvider, KnowledgeBase, ModelScope, ModelScopeProvider, Ollama, OllamaProvider, ProviderManager, SiliconFlow, SiliconFlowKnowledge, SiliconFlowProvider, Volces, VolcesProvider, Zhipu, ZhipuProvider, decryptAES, encryptAES, readStream };
749
- export type { AIConfig, AIModel, BaseChatInterface, BaseChatOptions, ChatMessage, ChatMessageComplete, ChatMessageOptions, ChatStream, EmbeddingMessage, EmbeddingMessageComplete, EmbeddingObject, GetProviderOpts, KnowledgeOptions, ProviderResult, RerankOptions, SecretKey, Usage };
610
+ export { AIUtils, BailianChat, BailianProvider, BaseChat, CNBChat, ChatProviderMap, Custom, CustomProvider, DeepSeek, DeepSeekProvider, Kevisual, KevisualProvider, Kimi, KimiProvider, KnowledgeBase, ModelScope, ModelScopeProvider, Ollama, OllamaProvider, ProviderManager, SiliconFlow, SiliconFlowKnowledge, SiliconFlowProvider, Volces, VolcesProvider, Zhipu, ZhipuProvider, readStream };
611
+ export type { BaseChatInterface, BaseChatOptions, ChatMessage, ChatMessageComplete, ChatMessageOptions, ChatStream, EmbeddingMessage, EmbeddingMessageComplete, EmbeddingObject, KnowledgeOptions, RerankOptions, Usage };