@websolutespa/bom-mixer-llm 1.8.25 → 1.8.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @websolutespa/bom-mixer-llm
2
2
 
3
+ ## 1.8.26
4
+
5
+ ### Patch Changes
6
+
7
+ - Fixing: decodeMessages
8
+
3
9
  ## 1.8.25
4
10
 
5
11
  ### Patch Changes
package/dist/cjs/index.js CHANGED
@@ -1518,21 +1518,21 @@ class MessageDecoder {
1518
1518
  chunks: x.content.map(x => this.decodeChunk(x))
1519
1519
  });
1520
1520
  } else {
1521
- /*
1522
- if (x.role === 'user') {
1523
- return ({
1524
- ...x,
1525
- chunks: [{
1526
- type: 'text',
1527
- text: x.content,
1528
- }],
1529
- });
1530
- }
1531
- */
1532
1521
  this.lastUnparsedText = '';
1533
- return Object.assign(Object.assign({}, x), {
1522
+ const message = Object.assign(Object.assign({}, x), {
1534
1523
  chunks: this.chunksToChunkItems(this.textToChunks(x.content))
1535
1524
  });
1525
+ if (message.chunks.length === 0) {
1526
+ const chunk = {
1527
+ type: 'text',
1528
+ text: x.content
1529
+ };
1530
+ return Object.assign(Object.assign({}, x), {
1531
+ chunks: [chunk],
1532
+ content: [chunk]
1533
+ });
1534
+ }
1535
+ return message;
1536
1536
  }
1537
1537
  });
1538
1538
  }