@ibiz-template-plugin/ai-chat 0.0.58 → 0.0.59

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/index.es.js CHANGED
@@ -5575,7 +5575,15 @@ class fo {
5575
5575
  r !== -1 ? (i.length > 0 && ((o = this.messages.value[r].chatsteps) == null || o.push(...i)), s.toolcalls = this.messages.value[r].toolcalls, s.chatsteps = this.messages.value[r].chatsteps, s.chatuiactions = this.messages.value[r].chatuiactions, this.messages.value[r].replace(e), this.messages.value = [...this.messages.value]) : (i.length > 0 && (e.chatsteps || (e.chatsteps = []), e.chatsteps.push(...i)), this.messages.value = [...this.messages.value, new wt(e)]), this.asyncToIndexDB(), e.type === "DEFAULT" && this.opts.recommendPrompt && t && this.opts.recommendPrompt(this.context, this.params, {
5576
5576
  appDataEntityId: this.appDataEntityId,
5577
5577
  message: {
5578
- messages: [e],
5578
+ messages: [
5579
+ {
5580
+ ...e,
5581
+ content: e.content.replace(
5582
+ new RegExp("\\<think\\>[^]*?\\<\\/think\\>", "gs"),
5583
+ ""
5584
+ )
5585
+ }
5586
+ ],
5579
5587
  sessionid: this.chatSessionid,
5580
5588
  srfaiagent: this.activeAIAgentID
5581
5589
  }
@@ -5623,7 +5631,7 @@ class fo {
5623
5631
  getMessages() {
5624
5632
  const e = this.messages.value.filter((t) => t.type !== "ERROR" && t.status !== "canceled").map((t) => t._origin);
5625
5633
  return e.forEach((t) => {
5626
- t.content = t.content.replace(new RegExp("\\<tool_call\\>[^]*?\\<\\/tool_call\\>", "gs"), "").trim();
5634
+ t.content = t.content.replace(new RegExp("\\<tool_call\\>[^]*?\\<\\/tool_call\\>", "gs"), "").replace(new RegExp("\\<think\\>[^]*?\\<\\/think\\>", "gs"), "").trim();
5627
5635
  }), e;
5628
5636
  }
5629
5637
  /**