supercompat 2.18.0 → 2.19.1
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.cjs +33 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +34 -13
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1697,13 +1697,40 @@ var models7 = function(param) {
|
|
|
1697
1697
|
// src/adapters/client/anthropicClientAdapter/completions/post.ts
|
|
1698
1698
|
import { uid, fork, omit as omit2, isEmpty as isEmpty2 } from "radash";
|
|
1699
1699
|
// src/lib/messages/nonEmptyMessages.ts
|
|
1700
|
-
import { isEmpty } from "radash";
|
|
1700
|
+
import { isEmpty, isArray } from "radash";
|
|
1701
|
+
var nonEmptyContent = function(param) {
|
|
1702
|
+
var message = param.message;
|
|
1703
|
+
if (isEmpty({
|
|
1704
|
+
value: message.content
|
|
1705
|
+
})) {
|
|
1706
|
+
return "-";
|
|
1707
|
+
}
|
|
1708
|
+
if (isArray(message.content)) {
|
|
1709
|
+
return message.content.map(function(content) {
|
|
1710
|
+
if (content.type === "text") {
|
|
1711
|
+
if (isEmpty(content.text)) {
|
|
1712
|
+
return {
|
|
1713
|
+
type: "text",
|
|
1714
|
+
text: "-"
|
|
1715
|
+
};
|
|
1716
|
+
} else {
|
|
1717
|
+
return content;
|
|
1718
|
+
}
|
|
1719
|
+
} else {
|
|
1720
|
+
return content;
|
|
1721
|
+
}
|
|
1722
|
+
});
|
|
1723
|
+
}
|
|
1724
|
+
return message.content;
|
|
1725
|
+
};
|
|
1701
1726
|
var nonEmptyMessages = function(param) {
|
|
1702
1727
|
var messages3 = param.messages;
|
|
1703
1728
|
var result = [];
|
|
1704
1729
|
messages3.forEach(function(message) {
|
|
1705
1730
|
return result.push(_object_spread_props(_object_spread({}, message), {
|
|
1706
|
-
content:
|
|
1731
|
+
content: nonEmptyContent({
|
|
1732
|
+
message: message
|
|
1733
|
+
})
|
|
1707
1734
|
}));
|
|
1708
1735
|
});
|
|
1709
1736
|
return result;
|
|
@@ -3816,9 +3843,7 @@ var get10 = function(param) {
|
|
|
3816
3843
|
hasNextPage: function() {
|
|
3817
3844
|
return messages3.length === parseInt(limit);
|
|
3818
3845
|
},
|
|
3819
|
-
|
|
3820
|
-
last_id: (_last_id = (_last = last(messages3)) === null || _last === void 0 ? void 0 : _last.id) !== null && _last_id !== void 0 ? _last_id : null
|
|
3821
|
-
}
|
|
3846
|
+
last_id: (_last_id = (_last = last(messages3)) === null || _last === void 0 ? void 0 : _last.id) !== null && _last_id !== void 0 ? _last_id : null
|
|
3822
3847
|
}), {
|
|
3823
3848
|
status: 200,
|
|
3824
3849
|
headers: {
|
|
@@ -3930,10 +3955,8 @@ var get11 = function(param) {
|
|
|
3930
3955
|
hasNextPage: function() {
|
|
3931
3956
|
return runs2.length === parseInt(limit);
|
|
3932
3957
|
},
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
last_id: (_last2_id = (_last2 = last2(runs2)) === null || _last2 === void 0 ? void 0 : _last2.id) !== null && _last2_id !== void 0 ? _last2_id : null
|
|
3936
|
-
}
|
|
3958
|
+
// @ts-ignore-next-line
|
|
3959
|
+
last_id: (_last2_id = (_last2 = last2(runs2)) === null || _last2 === void 0 ? void 0 : _last2.id) !== null && _last2_id !== void 0 ? _last2_id : null
|
|
3937
3960
|
}), {
|
|
3938
3961
|
status: 200,
|
|
3939
3962
|
headers: {
|
|
@@ -4590,10 +4613,8 @@ var get13 = function(param) {
|
|
|
4590
4613
|
hasNextPage: function() {
|
|
4591
4614
|
return runSteps.length === parseInt(limit);
|
|
4592
4615
|
},
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
last_id: (_last3_id = (_last3 = last3(runSteps)) === null || _last3 === void 0 ? void 0 : _last3.id) !== null && _last3_id !== void 0 ? _last3_id : null
|
|
4596
|
-
}
|
|
4616
|
+
// @ts-ignore-next-line
|
|
4617
|
+
last_id: (_last3_id = (_last3 = last3(runSteps)) === null || _last3 === void 0 ? void 0 : _last3.id) !== null && _last3_id !== void 0 ? _last3_id : null
|
|
4597
4618
|
}), {
|
|
4598
4619
|
status: 200,
|
|
4599
4620
|
headers: {
|