@kevisual/ai 0.0.13 → 0.0.14

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.
@@ -145,7 +145,7 @@ declare class BaseChat implements BaseChatInterface, BaseChatUsageInterface {
145
145
  total_tokens: number;
146
146
  completion_tokens: number;
147
147
  responseText: string;
148
- utils: AIUtils;
148
+ utils: typeof AIUtils;
149
149
  constructor(options: BaseChatOptions);
150
150
  post(url?: string, opts?: {
151
151
  headers?: Record<string, string>;
@@ -527,5 +527,5 @@ declare class AIConfigParser {
527
527
  };
528
528
  }
529
529
 
530
- export { AIConfigParser, BailianProvider, BaseChat, ChatProviderMap, CustomProvider, DeepSeekProvider, KimiProvider, KnowledgeBase, ModelScopeProvider, OllamaProvider, ProviderManager, SiliconFlowKnowledge, SiliconFlowProvider, VolcesProvider, ZhipuProvider, decryptAES, encryptAES, readStream };
530
+ export { AIConfigParser, AIUtils, BailianProvider, BaseChat, ChatProviderMap, CustomProvider, DeepSeekProvider, KimiProvider, KnowledgeBase, ModelScopeProvider, OllamaProvider, ProviderManager, SiliconFlowKnowledge, SiliconFlowProvider, VolcesProvider, ZhipuProvider, decryptAES, encryptAES, readStream };
531
531
  export type { AIConfig, AIModel, BaseChatInterface, BaseChatOptions, BaseChatUsageInterface, ChatMessage, ChatMessageComplete, ChatMessageOptions, ChatMessageStream, ChatStream, EmbeddingMessage, EmbeddingMessageComplete, GetProviderOpts, KnowledgeOptions, ProviderResult, RerankOptions, SecretKey };
@@ -18794,12 +18794,11 @@ class BaseChat {
18794
18794
  total_tokens;
18795
18795
  completion_tokens;
18796
18796
  responseText;
18797
- utils;
18797
+ utils = AIUtils;
18798
18798
  constructor(options) {
18799
18799
  this.baseURL = options.baseURL;
18800
18800
  this.model = options.model;
18801
18801
  this.apiKey = options.apiKey;
18802
- this.utils = new AIUtils;
18803
18802
  }
18804
18803
  post(url = "", opts = {}) {
18805
18804
  let _url = url.startsWith("http") ? url : this.baseURL + url;
@@ -19281,5 +19280,6 @@ export {
19281
19280
  ChatProviderMap,
19282
19281
  BaseChat,
19283
19282
  BailianProvider,
19283
+ AIUtils,
19284
19284
  AIConfigParser
19285
19285
  };
@@ -145,7 +145,7 @@ declare class BaseChat implements BaseChatInterface, BaseChatUsageInterface {
145
145
  total_tokens: number;
146
146
  completion_tokens: number;
147
147
  responseText: string;
148
- utils: AIUtils;
148
+ utils: typeof AIUtils;
149
149
  constructor(options: BaseChatOptions);
150
150
  post(url?: string, opts?: {
151
151
  headers?: Record<string, string>;
@@ -527,5 +527,5 @@ declare class AIConfigParser {
527
527
  };
528
528
  }
529
529
 
530
- export { AIConfigParser, BailianProvider, BaseChat, ChatProviderMap, CustomProvider, DeepSeekProvider, KimiProvider, KnowledgeBase, ModelScopeProvider, OllamaProvider, ProviderManager, SiliconFlowKnowledge, SiliconFlowProvider, VolcesProvider, ZhipuProvider, decryptAES, encryptAES, readStream };
530
+ export { AIConfigParser, AIUtils, BailianProvider, BaseChat, ChatProviderMap, CustomProvider, DeepSeekProvider, KimiProvider, KnowledgeBase, ModelScopeProvider, OllamaProvider, ProviderManager, SiliconFlowKnowledge, SiliconFlowProvider, VolcesProvider, ZhipuProvider, decryptAES, encryptAES, readStream };
531
531
  export type { AIConfig, AIModel, BaseChatInterface, BaseChatOptions, BaseChatUsageInterface, ChatMessage, ChatMessageComplete, ChatMessageOptions, ChatMessageStream, ChatStream, EmbeddingMessage, EmbeddingMessageComplete, GetProviderOpts, KnowledgeOptions, ProviderResult, RerankOptions, SecretKey };
@@ -1354,12 +1354,11 @@ class BaseChat {
1354
1354
  total_tokens;
1355
1355
  completion_tokens;
1356
1356
  responseText;
1357
- utils;
1357
+ utils = AIUtils;
1358
1358
  constructor(options) {
1359
1359
  this.baseURL = options.baseURL;
1360
1360
  this.model = options.model;
1361
1361
  this.apiKey = options.apiKey;
1362
- this.utils = new AIUtils;
1363
1362
  }
1364
1363
  post(url = "", opts = {}) {
1365
1364
  let _url = url.startsWith("http") ? url : this.baseURL + url;
@@ -1841,5 +1840,6 @@ export {
1841
1840
  ChatProviderMap,
1842
1841
  BaseChat,
1843
1842
  BailianProvider,
1843
+ AIUtils,
1844
1844
  AIConfigParser
1845
1845
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kevisual/ai",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "description": "AI Center Services",
5
5
  "main": "index.js",
6
6
  "basename": "/root/ai-center-services",
@@ -1,4 +1,3 @@
1
- import { OpenAI } from 'openai';
2
1
  import type {
3
2
  BaseChatInterface,
4
3
  ChatMessageComplete,
@@ -51,12 +50,11 @@ export class BaseChat implements BaseChatInterface, BaseChatUsageInterface {
51
50
  total_tokens: number;
52
51
  completion_tokens: number;
53
52
  responseText: string;
54
- utils: AIUtils;
53
+ utils = AIUtils;
55
54
  constructor(options: BaseChatOptions) {
56
55
  this.baseURL = options.baseURL;
57
56
  this.model = options.model;
58
57
  this.apiKey = options.apiKey;
59
- this.utils = new AIUtils();
60
58
  }
61
59
  post(url = '', opts: { headers?: Record<string, string>, data?: any } = {}) {
62
60
  let _url = url.startsWith('http') ? url : this.baseURL + url;
@@ -3,3 +3,5 @@ export * from './chat.ts';
3
3
  export * from './knowledge.ts';
4
4
 
5
5
  export * from './utils/index.ts';
6
+
7
+ export { AIUtils } from './core/utils/index.ts';