wingbot 3.67.25 → 3.67.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wingbot",
3
- "version": "3.67.25",
3
+ "version": "3.67.26",
4
4
  "description": "Enterprise Messaging Bot Conversation Engine",
5
5
  "main": "index.js",
6
6
  "type": "commonjs",
package/src/ChatGpt.js CHANGED
@@ -221,7 +221,7 @@ class ChatGpt {
221
221
  anonymize = true
222
222
  ) {
223
223
  const onlyFlag = Math.sign(limit) === -1 ? 'gpt' : null;
224
- const transcript = await res.getTranscript(Math.abs(limit), onlyFlag);
224
+ const transcript = await res.getTranscript(Math.abs(limit), onlyFlag, true);
225
225
 
226
226
  if (!anonymize) {
227
227
  return transcript;
package/src/Responder.js CHANGED
@@ -233,9 +233,10 @@ class Responder {
233
233
  *
234
234
  * @param {number} [limit]
235
235
  * @param {string} [onlyFlag]
236
+ * @param {boolean} [skipThisTurnaround]
236
237
  * @returns {Promise<Transcript[]>}
237
238
  */
238
- async getTranscript (limit = 10, onlyFlag = null) {
239
+ async getTranscript (limit = 10, onlyFlag = null, skipThisTurnaround = false) {
239
240
  const { chatLogStorage } = this._messageSender;
240
241
  if (!chatLogStorage) {
241
242
  return [];
@@ -247,13 +248,15 @@ class Responder {
247
248
  limit,
248
249
  onlyFlag
249
250
  );
250
- const { responseTexts = [], requestTexts = [] } = this._messageSender;
251
- transcript.push(...requestTexts.map((text) => ({
252
- fromBot: false, text
253
- })));
254
- transcript.push(...responseTexts.map((text) => ({
255
- fromBot: true, text
256
- })));
251
+ if (!skipThisTurnaround) {
252
+ const { responseTexts = [], requestTexts = [] } = this._messageSender;
253
+ transcript.push(...requestTexts.map((text) => ({
254
+ fromBot: false, text
255
+ })));
256
+ transcript.push(...responseTexts.map((text) => ({
257
+ fromBot: true, text
258
+ })));
259
+ }
257
260
  return transcript;
258
261
  }
259
262