@kevisual/ai 0.0.7 → 0.0.9

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,11 +1,16 @@
1
1
  import * as openai_resources_index_mjs from 'openai/resources/index.mjs';
2
2
  import OpenAI, { OpenAI as OpenAI$1 } from 'openai';
3
3
  import * as openai_resources_embeddings_mjs from 'openai/resources/embeddings.mjs';
4
- import * as _kevisual_permission from '@kevisual/permission';
5
- import { Permission } from '@kevisual/permission';
4
+ import { Permission as Permission$1 } from '@kevisual/permission';
6
5
 
7
6
  type ChatMessage = OpenAI.Chat.Completions.ChatCompletionMessageParam;
8
- type ChatMessageOptions = Partial<OpenAI.Chat.Completions.ChatCompletionCreateParams>;
7
+ type ChatMessageOptions = Partial<OpenAI.Chat.Completions.ChatCompletionCreateParams> & {
8
+ /**
9
+ * 是否能够思考
10
+ * 如果会话是千文,服务器的接口,默认为 true
11
+ */
12
+ enable_thinking?: boolean;
13
+ };
9
14
  type ChatMessageComplete = OpenAI.Chat.Completions.ChatCompletion;
10
15
  type ChatMessageStream = OpenAI.Chat.Completions.ChatCompletion;
11
16
  type EmbeddingMessage = Partial<OpenAI.Embeddings.EmbeddingCreateParams>;
@@ -51,7 +56,7 @@ type BaseChatOptions<T = Record<string, any>> = {
51
56
  */
52
57
  stream?: boolean;
53
58
  } & T;
54
- declare const getIsBrowser: () => any;
59
+ declare const getIsBrowser: () => boolean;
55
60
  declare class BaseChat implements BaseChatInterface, BaseChatUsageInterface {
56
61
  /**
57
62
  * 默认baseURL
@@ -172,7 +177,7 @@ declare class SiliconFlow extends BaseChat {
172
177
  static BASE_URL: string;
173
178
  constructor(options: SiliconFlowOptions);
174
179
  getUsageInfo(): Promise<SiliconFlowUsageResponse>;
175
- chat(messages: OpenAI$1.Chat.Completions.ChatCompletionMessageParam[], options?: Partial<OpenAI$1.Chat.Completions.ChatCompletionCreateParams>): Promise<OpenAI$1.Chat.Completions.ChatCompletion>;
180
+ chat(messages: OpenAI$1.Chat.Completions.ChatCompletionMessageParam[], options?: ChatMessageOptions): Promise<OpenAI$1.Chat.Completions.ChatCompletion>;
176
181
  }
177
182
 
178
183
  type OllamaOptions = BaseChatOptions;
@@ -290,7 +295,9 @@ declare class KnowledgeBase extends BaseChat {
290
295
  declare class SiliconFlowKnowledge extends KnowledgeBase {
291
296
  static BASE_URL: string;
292
297
  constructor(options: KnowledgeOptions);
293
- rerank(data: RerankOptions): Promise<any>;
298
+ rerank(data: RerankOptions): Promise<{
299
+ _request_id?: string | null;
300
+ }>;
294
301
  }
295
302
  type RerankOptions = {
296
303
  model: string;
@@ -343,7 +350,7 @@ type AIConfig = {
343
350
  description?: string;
344
351
  models: AIModel[];
345
352
  secretKeys: SecretKey[];
346
- permission?: Permission;
353
+ permission?: Permission$1;
347
354
  filter?: {
348
355
  objectKey: string;
349
356
  type: 'array' | 'object';
@@ -428,7 +435,7 @@ declare class AIConfigParser {
428
435
  title?: string;
429
436
  description?: string;
430
437
  models?: AIModel[];
431
- permission?: _kevisual_permission.Permission;
438
+ permission?: Permission;
432
439
  filter?: {
433
440
  objectKey: string;
434
441
  type: "array" | "object";