supercompat 2.19.1 → 2.19.3
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 -50
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -26
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1695,31 +1695,14 @@ var models7 = function(param) {
|
|
|
1695
1695
|
};
|
|
1696
1696
|
};
|
|
1697
1697
|
// src/adapters/client/anthropicClientAdapter/completions/post.ts
|
|
1698
|
-
import { uid, fork, omit as omit2, isEmpty
|
|
1698
|
+
import { uid, fork, omit as omit2, isEmpty } from "radash";
|
|
1699
1699
|
// src/lib/messages/nonEmptyMessages.ts
|
|
1700
|
-
import { isEmpty, isArray } from "radash";
|
|
1701
1700
|
var nonEmptyContent = function(param) {
|
|
1702
1701
|
var message = param.message;
|
|
1703
|
-
if (
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
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
|
-
});
|
|
1702
|
+
if (typeof message.content === "string") {
|
|
1703
|
+
if (!/\S/.test(message.content)) {
|
|
1704
|
+
return "-";
|
|
1705
|
+
}
|
|
1723
1706
|
}
|
|
1724
1707
|
return message.content;
|
|
1725
1708
|
};
|
|
@@ -1842,7 +1825,7 @@ var post5 = function(param) {
|
|
|
1842
1825
|
resultOptions = _object_spread_props(_object_spread({}, omit2(body, [
|
|
1843
1826
|
"response_format"
|
|
1844
1827
|
])), {
|
|
1845
|
-
stream: body.stream ?
|
|
1828
|
+
stream: body.stream ? isEmpty(body.tools) : false,
|
|
1846
1829
|
system: system,
|
|
1847
1830
|
messages: serializeMessages({
|
|
1848
1831
|
messages: chatMessages
|
|
@@ -3084,7 +3067,7 @@ var ollamaClientAdapter = function(param) {
|
|
|
3084
3067
|
};
|
|
3085
3068
|
// src/adapters/run/completionsRunAdapter/index.ts
|
|
3086
3069
|
import _ from "lodash";
|
|
3087
|
-
import { uid as uid2, omit as omit3, isEmpty as
|
|
3070
|
+
import { uid as uid2, omit as omit3, isEmpty as isEmpty2 } from "radash";
|
|
3088
3071
|
import dayjs from "dayjs";
|
|
3089
3072
|
// src/adapters/run/completionsRunAdapter/messages/index.ts
|
|
3090
3073
|
import { flat } from "radash";
|
|
@@ -3286,7 +3269,7 @@ var completionsRunAdapter = function() {
|
|
|
3286
3269
|
case 1:
|
|
3287
3270
|
opts = _object_spread.apply(void 0, [
|
|
3288
3271
|
(_tmp.messages = _state.sent(), _tmp.model = run2.model, _tmp.stream = true, _tmp.response_format = run2.response_format, _tmp),
|
|
3289
|
-
|
|
3272
|
+
isEmpty2(run2.tools) ? {} : {
|
|
3290
3273
|
tools: run2.tools
|
|
3291
3274
|
}
|
|
3292
3275
|
]);
|
|
@@ -3578,7 +3561,7 @@ var completionsRunAdapter = function() {
|
|
|
3578
3561
|
];
|
|
3579
3562
|
case 22:
|
|
3580
3563
|
message = _state.sent();
|
|
3581
|
-
if (
|
|
3564
|
+
if (isEmpty2(message.toolCalls)) {
|
|
3582
3565
|
return [
|
|
3583
3566
|
2,
|
|
3584
3567
|
onEvent2({
|