wechaty-web-panel 1.6.16 → 1.6.17
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/CHANGELOG.md +1 -1
- package/dist/cjs/src/botInstance/dify.js +3 -0
- package/dist/cjs/src/botInstance/officialOpenAi.js +3 -0
- package/dist/cjs/src/botInstance/unOfficialOpenAi.js +3 -0
- package/dist/cjs/src/package-json.js +1 -1
- package/dist/cjs/src/task/rss.js +2 -2
- package/dist/esm/src/botInstance/dify.js +3 -0
- package/dist/esm/src/botInstance/officialOpenAi.js +3 -0
- package/dist/esm/src/botInstance/unOfficialOpenAi.js +3 -0
- package/dist/esm/src/package-json.js +1 -1
- package/dist/esm/src/task/rss.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -70,6 +70,9 @@ class DifyAi {
|
|
|
70
70
|
if (systemMessage || content === 'reset' || content === '重置') {
|
|
71
71
|
console.log('重新更新上下文对话');
|
|
72
72
|
this.chatOption[uid] = {};
|
|
73
|
+
if (content === 'reset' || content === '重置') {
|
|
74
|
+
return [{ type: 1, content: '上下文已重置' }];
|
|
75
|
+
}
|
|
73
76
|
}
|
|
74
77
|
console.log('this.chatOption[uid]', this.chatOption[uid]);
|
|
75
78
|
const { conversationId, text } = systemMessage ? await this.difyChat.sendMessage(content, { ...this.chatOption[uid], systemMessage, timeoutMs: this.config.timeoutMs * 1000 || 80 * 1000, user: uid }) : await this.difyChat.sendMessage(content, { ...this.chatOption[uid], timeoutMs: this.config.timeoutMs * 1000 || 80 * 1000, user: uid });
|
|
@@ -128,6 +128,9 @@ class OfficialOpenAi {
|
|
|
128
128
|
if (systemMessage || content === 'reset' || content === '重置') {
|
|
129
129
|
console.log('重新更新上下文对话');
|
|
130
130
|
this.chatOption[uid] = {};
|
|
131
|
+
if (content === 'reset' || content === '重置') {
|
|
132
|
+
return [{ type: 1, content: '上下文已重置' }];
|
|
133
|
+
}
|
|
131
134
|
}
|
|
132
135
|
const { conversationId, text, id } = systemMessage ? await this.chatGPT.sendMessage(content, { ...this.chatOption[uid], systemMessage, timeoutMs: this.config.timeoutMs * 1000 || 80 * 1000 }) : await this.chatGPT.sendMessage(content, { ...this.chatOption[uid], timeoutMs: this.config.timeoutMs * 1000 || 80 * 1000 });
|
|
133
136
|
if (this.config.filter) {
|
|
@@ -87,6 +87,9 @@ class UnOfficialOpenAi {
|
|
|
87
87
|
question = systemMessage + content;
|
|
88
88
|
console.log('重新更新上下文对话');
|
|
89
89
|
this.chatOption[uid] = {};
|
|
90
|
+
if (content === 'reset' || content === '重置') {
|
|
91
|
+
return [{ type: 1, content: '上下文已重置' }];
|
|
92
|
+
}
|
|
90
93
|
}
|
|
91
94
|
const { conversationId, text, id } = systemMessage ? await this.chatGPT.sendMessage(question, { ...this.chatOption[uid], systemMessage, timeoutMs: this.config.timeoutMs * 1000 || 80 * 1000 }) : await this.chatGPT.sendMessage(question, { ...this.chatOption[uid], timeoutMs: this.config.timeoutMs * 1000 || 80 * 1000 });
|
|
92
95
|
if (this.config.record) {
|
package/dist/cjs/src/task/rss.js
CHANGED
|
@@ -45,11 +45,11 @@ async function getRssContent(info) {
|
|
|
45
45
|
async function setContent(feed, info) {
|
|
46
46
|
const eol = await (0, puppet_type_js_1.getPuppetEol)();
|
|
47
47
|
if (info.showLink) {
|
|
48
|
-
const res = { type: 4, url: feed.link, title: (0, index_js_1.delHtmlTag)(feed.title), description: (0, index_js_1.delHtmlTag)(feed.content.substring(0, 80)
|
|
48
|
+
const res = { type: 4, url: feed.link, title: (0, index_js_1.delHtmlTag)(feed.title), description: (0, index_js_1.delHtmlTag)(feed.content).substring(0, 80), thumbUrl: info.thumbUrl };
|
|
49
49
|
return [res];
|
|
50
50
|
}
|
|
51
51
|
else {
|
|
52
|
-
const content = `${info.prefixWord ? info.prefixWord + eol + eol : ''}
|
|
52
|
+
const content = `${info.prefixWord ? info.prefixWord + eol + eol : ''}${(0, index_js_1.delHtmlTag)(feed.title)}${eol}${eol}【摘要】:${(0, index_js_1.delHtmlTag)(feed.content).substring(0, 300)}...${eol}【链接】:${feed.link}${eol}${eol}${info.suffixWord || ''}`;
|
|
53
53
|
return [{ type: 1, content: content }];
|
|
54
54
|
}
|
|
55
55
|
}
|
|
@@ -65,6 +65,9 @@ class DifyAi {
|
|
|
65
65
|
if (systemMessage || content === 'reset' || content === '重置') {
|
|
66
66
|
console.log('重新更新上下文对话');
|
|
67
67
|
this.chatOption[uid] = {};
|
|
68
|
+
if (content === 'reset' || content === '重置') {
|
|
69
|
+
return [{ type: 1, content: '上下文已重置' }];
|
|
70
|
+
}
|
|
68
71
|
}
|
|
69
72
|
console.log('this.chatOption[uid]', this.chatOption[uid]);
|
|
70
73
|
const { conversationId, text } = systemMessage ? await this.difyChat.sendMessage(content, { ...this.chatOption[uid], systemMessage, timeoutMs: this.config.timeoutMs * 1000 || 80 * 1000, user: uid }) : await this.difyChat.sendMessage(content, { ...this.chatOption[uid], timeoutMs: this.config.timeoutMs * 1000 || 80 * 1000, user: uid });
|
|
@@ -123,6 +123,9 @@ class OfficialOpenAi {
|
|
|
123
123
|
if (systemMessage || content === 'reset' || content === '重置') {
|
|
124
124
|
console.log('重新更新上下文对话');
|
|
125
125
|
this.chatOption[uid] = {};
|
|
126
|
+
if (content === 'reset' || content === '重置') {
|
|
127
|
+
return [{ type: 1, content: '上下文已重置' }];
|
|
128
|
+
}
|
|
126
129
|
}
|
|
127
130
|
const { conversationId, text, id } = systemMessage ? await this.chatGPT.sendMessage(content, { ...this.chatOption[uid], systemMessage, timeoutMs: this.config.timeoutMs * 1000 || 80 * 1000 }) : await this.chatGPT.sendMessage(content, { ...this.chatOption[uid], timeoutMs: this.config.timeoutMs * 1000 || 80 * 1000 });
|
|
128
131
|
if (this.config.filter) {
|
|
@@ -82,6 +82,9 @@ class UnOfficialOpenAi {
|
|
|
82
82
|
question = systemMessage + content;
|
|
83
83
|
console.log('重新更新上下文对话');
|
|
84
84
|
this.chatOption[uid] = {};
|
|
85
|
+
if (content === 'reset' || content === '重置') {
|
|
86
|
+
return [{ type: 1, content: '上下文已重置' }];
|
|
87
|
+
}
|
|
85
88
|
}
|
|
86
89
|
const { conversationId, text, id } = systemMessage ? await this.chatGPT.sendMessage(question, { ...this.chatOption[uid], systemMessage, timeoutMs: this.config.timeoutMs * 1000 || 80 * 1000 }) : await this.chatGPT.sendMessage(question, { ...this.chatOption[uid], timeoutMs: this.config.timeoutMs * 1000 || 80 * 1000 });
|
|
87
90
|
if (this.config.record) {
|
package/dist/esm/src/task/rss.js
CHANGED
|
@@ -39,11 +39,11 @@ async function getRssContent(info) {
|
|
|
39
39
|
async function setContent(feed, info) {
|
|
40
40
|
const eol = await getPuppetEol();
|
|
41
41
|
if (info.showLink) {
|
|
42
|
-
const res = { type: 4, url: feed.link, title: delHtmlTag(feed.title), description: delHtmlTag(feed.content.substring(0, 80)
|
|
42
|
+
const res = { type: 4, url: feed.link, title: delHtmlTag(feed.title), description: delHtmlTag(feed.content).substring(0, 80), thumbUrl: info.thumbUrl };
|
|
43
43
|
return [res];
|
|
44
44
|
}
|
|
45
45
|
else {
|
|
46
|
-
const content = `${info.prefixWord ? info.prefixWord + eol + eol : ''}
|
|
46
|
+
const content = `${info.prefixWord ? info.prefixWord + eol + eol : ''}${delHtmlTag(feed.title)}${eol}${eol}【摘要】:${delHtmlTag(feed.content).substring(0, 300)}...${eol}【链接】:${feed.link}${eol}${eol}${info.suffixWord || ''}`;
|
|
47
47
|
return [{ type: 1, content: content }];
|
|
48
48
|
}
|
|
49
49
|
}
|