@kevisual/ai 0.0.18 → 0.0.19

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,25 +1,169 @@
1
- import * as openai_resources_index_mjs from 'openai/resources/index.mjs';
2
- import OpenAI, { OpenAI as OpenAI$1 } from 'openai';
3
- import * as openai_resources_embeddings_mjs from 'openai/resources/embeddings.mjs';
4
1
  import * as _kevisual_permission from '@kevisual/permission';
5
2
  import { Permission } from '@kevisual/permission';
6
3
 
7
- type ChatMessage = OpenAI.Chat.Completions.ChatCompletionMessageParam;
8
- type ChatMessageOptions = Partial<OpenAI.Chat.Completions.ChatCompletionCreateParams> & {
4
+ type ChatMessage = {
5
+ role?: 'user' | 'assistant' | 'system' | 'tool';
6
+ content: string;
7
+ };
8
+ type ChatMessageOptions = {
9
+ messages: ChatMessage[];
10
+ /**
11
+ * 模型名称
12
+ */
13
+ model?: string;
14
+ /**
15
+ * 温度参数,控制随机性 (0-2)
16
+ * 较高的值如0.8会使输出更随机,较低的值如0.2会使其更集中和确定
17
+ */
18
+ temperature?: number;
19
+ /**
20
+ * 核采样参数 (0-1)
21
+ * 与temperature类似,但使用不同的采样方法
22
+ */
23
+ top_p?: number;
24
+ /**
25
+ * 生成的最大令牌数
26
+ */
27
+ max_tokens?: number;
28
+ /**
29
+ * 停止序列
30
+ * 当遇到这些序列时停止生成
31
+ */
32
+ stop?: string | string[];
33
+ /**
34
+ * 频率惩罚 (-2.0 到 2.0)
35
+ * 正值会根据新令牌在文本中的现有频率来惩罚它们
36
+ */
37
+ frequency_penalty?: number;
38
+ /**
39
+ * 存在惩罚 (-2.0 到 2.0)
40
+ * 正值会根据新令牌是否出现在文本中来惩罚它们
41
+ */
42
+ presence_penalty?: number;
43
+ /**
44
+ * 流式输出
45
+ */
46
+ stream?: boolean;
9
47
  /**
10
48
  * 是否能够思考
11
49
  * 如果会话是千文,服务器的接口,默认为 true
12
50
  */
13
51
  enable_thinking?: boolean;
52
+ response_format?: 'text' | 'json' | 'xml' | 'html';
53
+ /**
54
+ * 工具调用参数
55
+ */
56
+ tool_calls?: any;
57
+ };
58
+ type Choice = {
59
+ finish_reason: 'stop' | 'length' | 'tool_calls' | 'content_filter' | 'function_call';
60
+ index: number;
61
+ message: {
62
+ role: 'assistant' | 'tool';
63
+ content: string;
64
+ };
65
+ };
66
+ type ChatMessageComplete = {
67
+ /**
68
+ * 聊天完成的唯一标识符
69
+ */
70
+ id: string;
71
+ /**
72
+ * 聊天完成选项列表
73
+ * 如果 n 大于 1,可以有多个选项
74
+ */
75
+ choices: Array<Choice>;
76
+ /**
77
+ * 聊天完成创建时的 Unix 时间戳(秒)
78
+ */
79
+ created: number;
80
+ /**
81
+ * 用于聊天完成的模型名称
82
+ */
83
+ model: string;
84
+ /**
85
+ * 对象类型,始终为 `chat.completion`
86
+ */
87
+ object: 'chat.completion';
88
+ /**
89
+ * 系统指纹
90
+ * 用于标识后端配置
91
+ */
92
+ system_fingerprint?: string;
93
+ /**
94
+ * 完成请求的使用统计信息
95
+ */
96
+ usage?: Usage;
97
+ };
98
+ /**
99
+ * 向量嵌入请求参数
100
+ */
101
+ type EmbeddingMessage = {
102
+ /**
103
+ * 输入文本或文本数组
104
+ * 要生成嵌入向量的文本内容
105
+ */
106
+ input: string | string[];
107
+ /**
108
+ * 模型名称
109
+ * 用于生成嵌入向量的模型
110
+ */
111
+ model: string;
112
+ /**
113
+ * 编码格式
114
+ * 返回的嵌入向量编码格式
115
+ */
116
+ encoding_format?: 'float' | 'base64';
117
+ /**
118
+ * 维度
119
+ * 输出嵌入向量的维度(某些模型支持)
120
+ */
121
+ dimensions?: number;
122
+ };
123
+ /**
124
+ * 单个嵌入向量对象
125
+ */
126
+ type EmbeddingObject = {
127
+ /**
128
+ * 对象类型,始终为 `embedding`
129
+ */
130
+ object: 'embedding';
131
+ /**
132
+ * 嵌入向量
133
+ * 浮点数数组,表示文本的向量表示
134
+ */
135
+ embedding: number[];
136
+ /**
137
+ * 索引位置
138
+ * 该嵌入在输入数组中的位置
139
+ */
140
+ index: number;
141
+ };
142
+ /**
143
+ * 向量嵌入响应结果
144
+ */
145
+ type EmbeddingMessageComplete = {
146
+ /**
147
+ * 对象类型,始终为 `list`
148
+ */
149
+ object: 'list';
150
+ /**
151
+ * 嵌入向量数据列表
152
+ */
153
+ data: EmbeddingObject[];
154
+ /**
155
+ * 使用的模型名称
156
+ */
157
+ model: string;
158
+ /**
159
+ * 使用统计信息
160
+ */
161
+ usage: Usage;
14
162
  };
15
- type ChatMessageComplete = OpenAI.Chat.Completions.ChatCompletion;
16
- type ChatMessageStream = OpenAI.Chat.Completions.ChatCompletion;
17
- type EmbeddingMessage = Partial<OpenAI.Embeddings.EmbeddingCreateParams>;
18
- type EmbeddingMessageComplete = OpenAI.Embeddings.CreateEmbeddingResponse;
19
163
  interface BaseChatInterface {
20
164
  chat(messages: ChatMessage[], options?: ChatMessageOptions): Promise<ChatMessageComplete>;
21
165
  }
22
- interface BaseChatUsageInterface {
166
+ interface Usage {
23
167
  /**
24
168
  * 提示词令牌
25
169
  */
@@ -132,7 +276,7 @@ type BaseChatOptions<T = Record<string, any>> = {
132
276
  */
133
277
  stream?: boolean;
134
278
  } & T;
135
- declare class BaseChat implements BaseChatInterface, BaseChatUsageInterface {
279
+ declare class BaseChat implements BaseChatInterface, Usage {
136
280
  /**
137
281
  * 默认baseURL
138
282
  */
@@ -163,6 +307,13 @@ declare class BaseChat implements BaseChatInterface, BaseChatUsageInterface {
163
307
  */
164
308
  chat(messages: ChatMessage[], options?: ChatMessageOptions): Promise<ChatMessageComplete>;
165
309
  chatStream(messages: ChatMessage[], options?: ChatMessageOptions): Promise<ChatStream>;
310
+ /**
311
+ * 简单提问接口
312
+ * @param message
313
+ * @param options
314
+ * @returns
315
+ */
316
+ question(message: string, options?: ChatMessageOptions): Promise<ChatMessageComplete>;
166
317
  /**
167
318
  * 获取聊天使用情况
168
319
  * @returns
@@ -211,7 +362,7 @@ type OllamaModel = {
211
362
  declare class Ollama extends BaseChat {
212
363
  static BASE_URL: string;
213
364
  constructor(options: OllamaOptions$1);
214
- chat(messages: ChatMessage[], options?: ChatMessageOptions): Promise<openai_resources_index_mjs.ChatCompletion>;
365
+ chat(messages: ChatMessage[], options?: ChatMessageOptions): Promise<ChatMessageComplete>;
215
366
  /**
216
367
  * 获取模型列表
217
368
  * @returns
@@ -249,7 +400,7 @@ declare class SiliconFlow extends BaseChat {
249
400
  static BASE_URL: string;
250
401
  constructor(options: SiliconFlowOptions);
251
402
  getUsageInfo(): Promise<SiliconFlowUsageResponse>;
252
- chat(messages: OpenAI$1.Chat.Completions.ChatCompletionMessageParam[], options?: ChatMessageOptions): Promise<OpenAI$1.Chat.Completions.ChatCompletion>;
403
+ chat(messages: ChatMessage[], options?: ChatMessageOptions): Promise<ChatMessageComplete>;
253
404
  }
254
405
 
255
406
  type OllamaOptions = BaseChatOptions;
@@ -348,7 +499,7 @@ declare class ProviderManager {
348
499
  provider: BaseChat;
349
500
  constructor(config: ProviderManagerConfig);
350
501
  static createProvider(config: ProviderManagerConfig): Promise<BaseChat>;
351
- chat(messages: ChatMessage[]): Promise<openai_resources_index_mjs.ChatCompletion>;
502
+ chat(messages: ChatMessage[]): Promise<ChatMessageComplete>;
352
503
  }
353
504
 
354
505
  type KnowledgeOptions<T = Record<string, any>> = BaseChatOptions<{
@@ -376,7 +527,7 @@ declare class KnowledgeBase extends BaseChat {
376
527
  */
377
528
  generateEmbedding(text: string | string[]): Promise<{
378
529
  code: number;
379
- data: openai_resources_embeddings_mjs.Embedding[];
530
+ data: EmbeddingObject[];
380
531
  message?: undefined;
381
532
  } | {
382
533
  code: any;
@@ -552,4 +703,4 @@ declare class AIConfigParser {
552
703
  }
553
704
 
554
705
  export { AIConfigParser, AIUtils, BailianChat, BailianProvider, BaseChat, 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 };
555
- export type { AIConfig, AIModel, BaseChatInterface, BaseChatOptions, BaseChatUsageInterface, ChatMessage, ChatMessageComplete, ChatMessageOptions, ChatMessageStream, ChatStream, EmbeddingMessage, EmbeddingMessageComplete, GetProviderOpts, KnowledgeOptions, ProviderResult, RerankOptions, SecretKey };
706
+ export type { AIConfig, AIModel, BaseChatInterface, BaseChatOptions, ChatMessage, ChatMessageComplete, ChatMessageOptions, ChatStream, EmbeddingMessage, EmbeddingMessageComplete, EmbeddingObject, GetProviderOpts, KnowledgeOptions, ProviderResult, RerankOptions, SecretKey, Usage };
@@ -18892,6 +18892,12 @@ class BaseChat {
18892
18892
  });
18893
18893
  return stream;
18894
18894
  }
18895
+ question(message, options) {
18896
+ const messages = [
18897
+ { role: "user", content: message }
18898
+ ];
18899
+ return this.chat(messages, options);
18900
+ }
18895
18901
  getChatUsage() {
18896
18902
  return {
18897
18903
  prompt_tokens: this.prompt_tokens,
@@ -1,25 +1,169 @@
1
- import * as openai_resources_index_mjs from 'openai/resources/index.mjs';
2
- import OpenAI, { OpenAI as OpenAI$1 } from 'openai';
3
- import * as openai_resources_embeddings_mjs from 'openai/resources/embeddings.mjs';
4
1
  import * as _kevisual_permission from '@kevisual/permission';
5
2
  import { Permission } from '@kevisual/permission';
6
3
 
7
- type ChatMessage = OpenAI.Chat.Completions.ChatCompletionMessageParam;
8
- type ChatMessageOptions = Partial<OpenAI.Chat.Completions.ChatCompletionCreateParams> & {
4
+ type ChatMessage = {
5
+ role?: 'user' | 'assistant' | 'system' | 'tool';
6
+ content: string;
7
+ };
8
+ type ChatMessageOptions = {
9
+ messages: ChatMessage[];
10
+ /**
11
+ * 模型名称
12
+ */
13
+ model?: string;
14
+ /**
15
+ * 温度参数,控制随机性 (0-2)
16
+ * 较高的值如0.8会使输出更随机,较低的值如0.2会使其更集中和确定
17
+ */
18
+ temperature?: number;
19
+ /**
20
+ * 核采样参数 (0-1)
21
+ * 与temperature类似,但使用不同的采样方法
22
+ */
23
+ top_p?: number;
24
+ /**
25
+ * 生成的最大令牌数
26
+ */
27
+ max_tokens?: number;
28
+ /**
29
+ * 停止序列
30
+ * 当遇到这些序列时停止生成
31
+ */
32
+ stop?: string | string[];
33
+ /**
34
+ * 频率惩罚 (-2.0 到 2.0)
35
+ * 正值会根据新令牌在文本中的现有频率来惩罚它们
36
+ */
37
+ frequency_penalty?: number;
38
+ /**
39
+ * 存在惩罚 (-2.0 到 2.0)
40
+ * 正值会根据新令牌是否出现在文本中来惩罚它们
41
+ */
42
+ presence_penalty?: number;
43
+ /**
44
+ * 流式输出
45
+ */
46
+ stream?: boolean;
9
47
  /**
10
48
  * 是否能够思考
11
49
  * 如果会话是千文,服务器的接口,默认为 true
12
50
  */
13
51
  enable_thinking?: boolean;
52
+ response_format?: 'text' | 'json' | 'xml' | 'html';
53
+ /**
54
+ * 工具调用参数
55
+ */
56
+ tool_calls?: any;
57
+ };
58
+ type Choice = {
59
+ finish_reason: 'stop' | 'length' | 'tool_calls' | 'content_filter' | 'function_call';
60
+ index: number;
61
+ message: {
62
+ role: 'assistant' | 'tool';
63
+ content: string;
64
+ };
65
+ };
66
+ type ChatMessageComplete = {
67
+ /**
68
+ * 聊天完成的唯一标识符
69
+ */
70
+ id: string;
71
+ /**
72
+ * 聊天完成选项列表
73
+ * 如果 n 大于 1,可以有多个选项
74
+ */
75
+ choices: Array<Choice>;
76
+ /**
77
+ * 聊天完成创建时的 Unix 时间戳(秒)
78
+ */
79
+ created: number;
80
+ /**
81
+ * 用于聊天完成的模型名称
82
+ */
83
+ model: string;
84
+ /**
85
+ * 对象类型,始终为 `chat.completion`
86
+ */
87
+ object: 'chat.completion';
88
+ /**
89
+ * 系统指纹
90
+ * 用于标识后端配置
91
+ */
92
+ system_fingerprint?: string;
93
+ /**
94
+ * 完成请求的使用统计信息
95
+ */
96
+ usage?: Usage;
97
+ };
98
+ /**
99
+ * 向量嵌入请求参数
100
+ */
101
+ type EmbeddingMessage = {
102
+ /**
103
+ * 输入文本或文本数组
104
+ * 要生成嵌入向量的文本内容
105
+ */
106
+ input: string | string[];
107
+ /**
108
+ * 模型名称
109
+ * 用于生成嵌入向量的模型
110
+ */
111
+ model: string;
112
+ /**
113
+ * 编码格式
114
+ * 返回的嵌入向量编码格式
115
+ */
116
+ encoding_format?: 'float' | 'base64';
117
+ /**
118
+ * 维度
119
+ * 输出嵌入向量的维度(某些模型支持)
120
+ */
121
+ dimensions?: number;
122
+ };
123
+ /**
124
+ * 单个嵌入向量对象
125
+ */
126
+ type EmbeddingObject = {
127
+ /**
128
+ * 对象类型,始终为 `embedding`
129
+ */
130
+ object: 'embedding';
131
+ /**
132
+ * 嵌入向量
133
+ * 浮点数数组,表示文本的向量表示
134
+ */
135
+ embedding: number[];
136
+ /**
137
+ * 索引位置
138
+ * 该嵌入在输入数组中的位置
139
+ */
140
+ index: number;
141
+ };
142
+ /**
143
+ * 向量嵌入响应结果
144
+ */
145
+ type EmbeddingMessageComplete = {
146
+ /**
147
+ * 对象类型,始终为 `list`
148
+ */
149
+ object: 'list';
150
+ /**
151
+ * 嵌入向量数据列表
152
+ */
153
+ data: EmbeddingObject[];
154
+ /**
155
+ * 使用的模型名称
156
+ */
157
+ model: string;
158
+ /**
159
+ * 使用统计信息
160
+ */
161
+ usage: Usage;
14
162
  };
15
- type ChatMessageComplete = OpenAI.Chat.Completions.ChatCompletion;
16
- type ChatMessageStream = OpenAI.Chat.Completions.ChatCompletion;
17
- type EmbeddingMessage = Partial<OpenAI.Embeddings.EmbeddingCreateParams>;
18
- type EmbeddingMessageComplete = OpenAI.Embeddings.CreateEmbeddingResponse;
19
163
  interface BaseChatInterface {
20
164
  chat(messages: ChatMessage[], options?: ChatMessageOptions): Promise<ChatMessageComplete>;
21
165
  }
22
- interface BaseChatUsageInterface {
166
+ interface Usage {
23
167
  /**
24
168
  * 提示词令牌
25
169
  */
@@ -132,7 +276,7 @@ type BaseChatOptions<T = Record<string, any>> = {
132
276
  */
133
277
  stream?: boolean;
134
278
  } & T;
135
- declare class BaseChat implements BaseChatInterface, BaseChatUsageInterface {
279
+ declare class BaseChat implements BaseChatInterface, Usage {
136
280
  /**
137
281
  * 默认baseURL
138
282
  */
@@ -163,6 +307,13 @@ declare class BaseChat implements BaseChatInterface, BaseChatUsageInterface {
163
307
  */
164
308
  chat(messages: ChatMessage[], options?: ChatMessageOptions): Promise<ChatMessageComplete>;
165
309
  chatStream(messages: ChatMessage[], options?: ChatMessageOptions): Promise<ChatStream>;
310
+ /**
311
+ * 简单提问接口
312
+ * @param message
313
+ * @param options
314
+ * @returns
315
+ */
316
+ question(message: string, options?: ChatMessageOptions): Promise<ChatMessageComplete>;
166
317
  /**
167
318
  * 获取聊天使用情况
168
319
  * @returns
@@ -211,7 +362,7 @@ type OllamaModel = {
211
362
  declare class Ollama extends BaseChat {
212
363
  static BASE_URL: string;
213
364
  constructor(options: OllamaOptions$1);
214
- chat(messages: ChatMessage[], options?: ChatMessageOptions): Promise<openai_resources_index_mjs.ChatCompletion>;
365
+ chat(messages: ChatMessage[], options?: ChatMessageOptions): Promise<ChatMessageComplete>;
215
366
  /**
216
367
  * 获取模型列表
217
368
  * @returns
@@ -249,7 +400,7 @@ declare class SiliconFlow extends BaseChat {
249
400
  static BASE_URL: string;
250
401
  constructor(options: SiliconFlowOptions);
251
402
  getUsageInfo(): Promise<SiliconFlowUsageResponse>;
252
- chat(messages: OpenAI$1.Chat.Completions.ChatCompletionMessageParam[], options?: ChatMessageOptions): Promise<OpenAI$1.Chat.Completions.ChatCompletion>;
403
+ chat(messages: ChatMessage[], options?: ChatMessageOptions): Promise<ChatMessageComplete>;
253
404
  }
254
405
 
255
406
  type OllamaOptions = BaseChatOptions;
@@ -348,7 +499,7 @@ declare class ProviderManager {
348
499
  provider: BaseChat;
349
500
  constructor(config: ProviderManagerConfig);
350
501
  static createProvider(config: ProviderManagerConfig): Promise<BaseChat>;
351
- chat(messages: ChatMessage[]): Promise<openai_resources_index_mjs.ChatCompletion>;
502
+ chat(messages: ChatMessage[]): Promise<ChatMessageComplete>;
352
503
  }
353
504
 
354
505
  type KnowledgeOptions<T = Record<string, any>> = BaseChatOptions<{
@@ -376,7 +527,7 @@ declare class KnowledgeBase extends BaseChat {
376
527
  */
377
528
  generateEmbedding(text: string | string[]): Promise<{
378
529
  code: number;
379
- data: openai_resources_embeddings_mjs.Embedding[];
530
+ data: EmbeddingObject[];
380
531
  message?: undefined;
381
532
  } | {
382
533
  code: any;
@@ -552,4 +703,4 @@ declare class AIConfigParser {
552
703
  }
553
704
 
554
705
  export { AIConfigParser, AIUtils, BailianChat, BailianProvider, BaseChat, 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 };
555
- export type { AIConfig, AIModel, BaseChatInterface, BaseChatOptions, BaseChatUsageInterface, ChatMessage, ChatMessageComplete, ChatMessageOptions, ChatMessageStream, ChatStream, EmbeddingMessage, EmbeddingMessageComplete, GetProviderOpts, KnowledgeOptions, ProviderResult, RerankOptions, SecretKey };
706
+ export type { AIConfig, AIModel, BaseChatInterface, BaseChatOptions, ChatMessage, ChatMessageComplete, ChatMessageOptions, ChatStream, EmbeddingMessage, EmbeddingMessageComplete, EmbeddingObject, GetProviderOpts, KnowledgeOptions, ProviderResult, RerankOptions, SecretKey, Usage };
@@ -1452,6 +1452,12 @@ class BaseChat {
1452
1452
  });
1453
1453
  return stream;
1454
1454
  }
1455
+ question(message, options) {
1456
+ const messages = [
1457
+ { role: "user", content: message }
1458
+ ];
1459
+ return this.chat(messages, options);
1460
+ }
1455
1461
  getChatUsage() {
1456
1462
  return {
1457
1463
  prompt_tokens: this.prompt_tokens,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kevisual/ai",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "description": "AI Center Services",
5
5
  "main": "index.js",
6
6
  "basename": "/root/ai-center-services",
@@ -1,5 +1,4 @@
1
1
  import { BaseChat, BaseChatOptions } from '../core/chat.ts';
2
- import { OpenAI } from 'openai';
3
2
  import type { ChatMessage, ChatMessageOptions } from '../core/index.ts';
4
3
 
5
4
  export type SiliconFlowOptions = Partial<BaseChatOptions>;
@@ -33,7 +32,7 @@ export class SiliconFlow extends BaseChat {
33
32
  async getUsageInfo(): Promise<SiliconFlowUsageResponse> {
34
33
  return this.get('/user/info');
35
34
  }
36
- async chat(messages: OpenAI.Chat.Completions.ChatCompletionMessageParam[], options?: ChatMessageOptions) {
35
+ async chat(messages: ChatMessage[], options?: ChatMessageOptions) {
37
36
  const res = await super.chat(messages, options);
38
37
  return res;
39
38
  }
@@ -3,7 +3,7 @@ import type {
3
3
  ChatMessageComplete,
4
4
  ChatMessage,
5
5
  ChatMessageOptions,
6
- BaseChatUsageInterface,
6
+ Usage,
7
7
  ChatStream,
8
8
  EmbeddingMessage,
9
9
  EmbeddingMessageComplete,
@@ -37,7 +37,7 @@ export type BaseChatOptions<T = Record<string, any>> = {
37
37
  stream?: boolean;
38
38
  } & T;
39
39
 
40
- export class BaseChat implements BaseChatInterface, BaseChatUsageInterface {
40
+ export class BaseChat implements BaseChatInterface, Usage {
41
41
  /**
42
42
  * 默认baseURL
43
43
  */
@@ -168,7 +168,18 @@ export class BaseChat implements BaseChatInterface, BaseChatUsageInterface {
168
168
 
169
169
  return stream as unknown as ChatStream;
170
170
  }
171
-
171
+ /**
172
+ * 简单提问接口
173
+ * @param message
174
+ * @param options
175
+ * @returns
176
+ */
177
+ question(message: string, options?: ChatMessageOptions) {
178
+ const messages: ChatMessage[] = [
179
+ { role: 'user', content: message }
180
+ ];
181
+ return this.chat(messages, options);
182
+ }
172
183
  /**
173
184
  * 获取聊天使用情况
174
185
  * @returns