@maiyunnet/kebab 3.2.33 → 3.2.34
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.
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/lib/ai.d.ts +2 -2
- package/lib/ai.js +2 -2
- package/package.json +1 -1
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* --- 本文件用来定义每个目录实体地址的常量 ---
|
|
7
7
|
*/
|
|
8
8
|
/** --- 当前系统版本号 --- */
|
|
9
|
-
export const VER = '3.2.
|
|
9
|
+
export const VER = '3.2.34';
|
|
10
10
|
// --- 服务端用的路径 ---
|
|
11
11
|
const imu = decodeURIComponent(import.meta.url).replace('file://', '').replace(/^\/(\w:)/, '$1');
|
|
12
12
|
/** --- /xxx/xxx --- */
|
package/lib/ai.d.ts
CHANGED
|
@@ -40,9 +40,9 @@ export declare class Ai {
|
|
|
40
40
|
private readonly _ctr;
|
|
41
41
|
constructor(ctr: sCtr.Ctr, opt: IOptions);
|
|
42
42
|
/** --- 创建非流式对话 --- */
|
|
43
|
-
chat(body: openai.default.Chat.Completions.ChatCompletionCreateParamsNonStreaming): openai.APIPromise<openai.default.Chat.ChatCompletion> | false
|
|
43
|
+
chat(body: openai.default.Chat.Completions.ChatCompletionCreateParamsNonStreaming): Promise<openai.APIPromise<openai.default.Chat.ChatCompletion> | false>;
|
|
44
44
|
/** --- 创建流式对话 --- */
|
|
45
|
-
chat(body: openai.default.Chat.Completions.ChatCompletionCreateParamsStreaming): openai.APIPromise<streaming.Stream<openai.default.Chat.ChatCompletionChunk>> | false
|
|
45
|
+
chat(body: openai.default.Chat.Completions.ChatCompletionCreateParamsStreaming): Promise<openai.APIPromise<streaming.Stream<openai.default.Chat.ChatCompletionChunk>> | false>;
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
48
|
* --- 创建一个 AI 对象 ---
|
package/lib/ai.js
CHANGED
|
@@ -73,9 +73,9 @@ export class Ai {
|
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
75
|
/** --- 创建对话 --- */
|
|
76
|
-
chat(body) {
|
|
76
|
+
async chat(body) {
|
|
77
77
|
try {
|
|
78
|
-
return this.link.chat.completions.create(body);
|
|
78
|
+
return await this.link.chat.completions.create(body);
|
|
79
79
|
}
|
|
80
80
|
catch (e) {
|
|
81
81
|
lCore.debug('[AI][CHAT]', e);
|