doomiaichat 7.0.2 → 7.0.3
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/dist/aimp.js +3 -5
- package/package.json +1 -1
- package/src/aimp.ts +3 -6
package/dist/aimp.js
CHANGED
|
@@ -48,7 +48,7 @@ class AIMiddlePlatform extends gptbase_1.default {
|
|
|
48
48
|
var _a;
|
|
49
49
|
return __awaiter(this, void 0, void 0, function* () {
|
|
50
50
|
if (!chatText) {
|
|
51
|
-
this.emit('chaterror', { successed: false, error: 'no text in chat' });
|
|
51
|
+
// this.emit('chaterror', { successed: false, error: 'no text in chat' });
|
|
52
52
|
return { successed: false, error: 'no text in chat' };
|
|
53
53
|
}
|
|
54
54
|
const question = typeof chatText === 'object' ? (_a = chatText.text) !== null && _a !== void 0 ? _a : chatText.content : chatText;
|
|
@@ -61,14 +61,12 @@ class AIMiddlePlatform extends gptbase_1.default {
|
|
|
61
61
|
session_id: callChatOption.session_id,
|
|
62
62
|
stream: false
|
|
63
63
|
} }, axiosOption);
|
|
64
|
-
console.log('Question===>', question);
|
|
65
64
|
const response = yield (0, declare_1.request)(opts);
|
|
66
65
|
if (!response.successed)
|
|
67
66
|
return { successed: false, error: 'failed' };
|
|
68
|
-
console.log('reponse===>', response.data);
|
|
69
67
|
const { answer: message, session_id } = response.data.data;
|
|
70
|
-
this.emit('chatdone', { successed: true, segment: message, text: message, finish_reason: 'stop', index: 0, session_id })
|
|
71
|
-
return { successed: true, message, session_id };
|
|
68
|
+
// this.emit('chatdone', { successed: true, segment: message, text: message, finish_reason: 'stop', index: 0, session_id })
|
|
69
|
+
return { successed: true, message: [{ message: { content: message } }], session_id };
|
|
72
70
|
});
|
|
73
71
|
}
|
|
74
72
|
/**
|
package/package.json
CHANGED
package/src/aimp.ts
CHANGED
|
@@ -29,7 +29,7 @@ export default class AIMiddlePlatform extends GptBase {
|
|
|
29
29
|
*/
|
|
30
30
|
public async chatRequest(chatText: string | any, callChatOption: any, axiosOption: any = {}): Promise<any> {
|
|
31
31
|
if (!chatText) {
|
|
32
|
-
this.emit('chaterror', { successed: false, error: 'no text in chat' });
|
|
32
|
+
// this.emit('chaterror', { successed: false, error: 'no text in chat' });
|
|
33
33
|
return { successed: false, error: 'no text in chat' };
|
|
34
34
|
}
|
|
35
35
|
const question = typeof chatText === 'object' ? chatText.text ?? chatText.content : chatText;
|
|
@@ -48,14 +48,11 @@ export default class AIMiddlePlatform extends GptBase {
|
|
|
48
48
|
},
|
|
49
49
|
...axiosOption
|
|
50
50
|
}
|
|
51
|
-
console.log('Question===>', question)
|
|
52
51
|
const response = await request(opts);
|
|
53
|
-
|
|
54
52
|
if (!response.successed) return { successed: false, error: 'failed' };
|
|
55
|
-
console.log('reponse===>', response.data)
|
|
56
53
|
const {answer:message,session_id} = response.data.data;
|
|
57
|
-
this.emit('chatdone', { successed: true, segment: message, text: message, finish_reason: 'stop', index: 0, session_id })
|
|
58
|
-
return { successed: true, message,session_id };
|
|
54
|
+
// this.emit('chatdone', { successed: true, segment: message, text: message, finish_reason: 'stop', index: 0, session_id })
|
|
55
|
+
return { successed: true, message:[{message:{content:message}}],session_id };
|
|
59
56
|
}
|
|
60
57
|
/**
|
|
61
58
|
* 流式传输聊天请求
|