doomiaichat 7.1.24 → 7.1.26
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/corzbot.js +9 -5
- package/package.json +1 -1
- package/src/corzbot.ts +5 -3
package/dist/corzbot.js
CHANGED
|
@@ -135,7 +135,7 @@ class CorzBot extends gptbase_1.default {
|
|
|
135
135
|
* @param _axiosOption
|
|
136
136
|
*/
|
|
137
137
|
getRequestStream(client, message, callChatOption = {}) {
|
|
138
|
-
var _a, _b
|
|
138
|
+
var _a, _b;
|
|
139
139
|
return __awaiter(this, void 0, void 0, function* () {
|
|
140
140
|
//简单的对话请求
|
|
141
141
|
if (this.botid) {
|
|
@@ -155,18 +155,22 @@ class CorzBot extends gptbase_1.default {
|
|
|
155
155
|
workflow_id: this.workflowid,
|
|
156
156
|
is_async: false,
|
|
157
157
|
// parameters: Object.assign({ input: message[0]?.content }, this.setting.customVariables || {}, callChatOption.customVariables || {}),
|
|
158
|
-
parameters: Object.assign({ request_src: 1 }, callChatOption.parameters || {}, { input:
|
|
158
|
+
// parameters: Object.assign({ request_src: 1 }, callChatOption.parameters || {}, { input: message[0]?.content })
|
|
159
|
+
parameters: Object.assign({ request_src: 1 }, callChatOption.parameters || {}, { input: message })
|
|
159
160
|
};
|
|
161
|
+
if (callChatOption.userid || callChatOption.cozeUserID)
|
|
162
|
+
worflowreq.ext = Object.assign({}, worflowreq.ext || {}, { user_id: callChatOption.userid || callChatOption.cozeUserID });
|
|
160
163
|
return worflowreq;
|
|
161
164
|
}
|
|
162
165
|
const worflowreq = {
|
|
163
166
|
additional_messages: message,
|
|
164
|
-
ext:
|
|
167
|
+
ext: { user_id: '12345678' },
|
|
165
168
|
workflow_id: this.talkflowid,
|
|
166
|
-
conversation_id: (
|
|
169
|
+
conversation_id: (_b = callChatOption.session_id) !== null && _b !== void 0 ? _b : yield this.createCoversation(client),
|
|
167
170
|
parameters: Object.assign({ request_src: 1 }, callChatOption.parameters || {}) //Object.assign({}, this.setting.customVariables || {}, callChatOption.customVariables || {}),
|
|
168
|
-
//parameters: { input: message[0]?.content }
|
|
169
171
|
};
|
|
172
|
+
if (callChatOption.userid || callChatOption.cozeUserID)
|
|
173
|
+
worflowreq.ext = Object.assign({}, worflowreq.ext || {}, { user_id: callChatOption.userid || callChatOption.cozeUserID });
|
|
170
174
|
return worflowreq;
|
|
171
175
|
});
|
|
172
176
|
}
|
package/package.json
CHANGED
package/src/corzbot.ts
CHANGED
|
@@ -143,18 +143,20 @@ export default class CorzBot extends GptBase {
|
|
|
143
143
|
workflow_id: this.workflowid,//callChatOption.workflowid,
|
|
144
144
|
is_async: false,
|
|
145
145
|
// parameters: Object.assign({ input: message[0]?.content }, this.setting.customVariables || {}, callChatOption.customVariables || {}),
|
|
146
|
-
parameters: Object.assign({ request_src: 1 }, callChatOption.parameters || {}, { input: message[0]?.content })
|
|
146
|
+
// parameters: Object.assign({ request_src: 1 }, callChatOption.parameters || {}, { input: message[0]?.content })
|
|
147
|
+
parameters: Object.assign({ request_src: 1 }, callChatOption.parameters || {}, { input: message})
|
|
147
148
|
}
|
|
149
|
+
if (callChatOption.userid || callChatOption.cozeUserID) worflowreq.ext = Object.assign({}, worflowreq.ext || {}, { user_id: callChatOption.userid || callChatOption.cozeUserID });
|
|
148
150
|
return worflowreq as T;
|
|
149
151
|
}
|
|
150
152
|
const worflowreq: ChatWorkflowReq = {
|
|
151
153
|
additional_messages: message,
|
|
152
|
-
ext:
|
|
154
|
+
ext: {user_id:'12345678'},
|
|
153
155
|
workflow_id: this.talkflowid!,//callChatOption.workflowid,
|
|
154
156
|
conversation_id: callChatOption.session_id ?? await this.createCoversation(client),
|
|
155
157
|
parameters: Object.assign({ request_src: 1 }, callChatOption.parameters || {}) //Object.assign({}, this.setting.customVariables || {}, callChatOption.customVariables || {}),
|
|
156
|
-
//parameters: { input: message[0]?.content }
|
|
157
158
|
}
|
|
159
|
+
if (callChatOption.userid || callChatOption.cozeUserID) worflowreq.ext = Object.assign({}, worflowreq.ext||{}, { user_id: callChatOption.userid || callChatOption.cozeUserID });
|
|
158
160
|
return worflowreq as T;
|
|
159
161
|
}
|
|
160
162
|
/**
|