supercompat 2.19.3 → 2.21.0
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 +45 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +45 -6
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -1451,6 +1451,11 @@ var mistralClientAdapter = function(param) {
|
|
|
1451
1451
|
};
|
|
1452
1452
|
// src/adapters/client/perplexityClientAdapter/models/get.ts
|
|
1453
1453
|
var models4 = [
|
|
1454
|
+
"sonar-reasoning-pro",
|
|
1455
|
+
"sonar-reasoning",
|
|
1456
|
+
"sonar-pro",
|
|
1457
|
+
"sonar",
|
|
1458
|
+
"r1-1776",
|
|
1454
1459
|
"llama-3.1-sonar-small-128k-online",
|
|
1455
1460
|
"llama-3.1-sonar-large-128k-online",
|
|
1456
1461
|
"llama-3.1-sonar-huge-128k-online"
|
|
@@ -2461,10 +2466,11 @@ var togetherClientAdapter = function(param) {
|
|
|
2461
2466
|
// src/adapters/client/googleClientAdapter/models/get.ts
|
|
2462
2467
|
var models9 = [
|
|
2463
2468
|
"gemini-2.0-flash-exp",
|
|
2469
|
+
"gemini-2.0-flash",
|
|
2470
|
+
"gemini-2.0-flash-lite-preview-02-05",
|
|
2464
2471
|
"gemini-1.5-flash",
|
|
2465
2472
|
"gemini-1.5-flash-8b",
|
|
2466
2473
|
"gemini-1.5-pro",
|
|
2467
|
-
"gemini-1.0-pro",
|
|
2468
2474
|
"text-embedding-004",
|
|
2469
2475
|
"aqa"
|
|
2470
2476
|
];
|
|
@@ -2524,29 +2530,35 @@ var models10 = function(param) {
|
|
|
2524
2530
|
};
|
|
2525
2531
|
};
|
|
2526
2532
|
// src/adapters/client/googleClientAdapter/completions/post.ts
|
|
2533
|
+
var import_cuid2 = require("@paralleldrive/cuid2");
|
|
2527
2534
|
var post7 = function(param) {
|
|
2528
2535
|
var google = param.google;
|
|
2529
2536
|
return /*#__PURE__*/ function() {
|
|
2530
2537
|
var _ref = _async_to_generator(function(_url, options) {
|
|
2531
|
-
var body, response, stream, data, error;
|
|
2538
|
+
var body, resultOptions, response, stream, data, error;
|
|
2532
2539
|
return _ts_generator(this, function(_state) {
|
|
2533
2540
|
switch(_state.label){
|
|
2534
2541
|
case 0:
|
|
2535
2542
|
body = JSON.parse(options.body);
|
|
2543
|
+
resultOptions = _object_spread_props(_object_spread({}, body), {
|
|
2544
|
+
messages: nonEmptyMessages({
|
|
2545
|
+
messages: body.messages
|
|
2546
|
+
})
|
|
2547
|
+
});
|
|
2536
2548
|
if (!body.stream) return [
|
|
2537
2549
|
3,
|
|
2538
2550
|
2
|
|
2539
2551
|
];
|
|
2540
2552
|
return [
|
|
2541
2553
|
4,
|
|
2542
|
-
google.chat.completions.create(
|
|
2554
|
+
google.chat.completions.create(resultOptions)
|
|
2543
2555
|
];
|
|
2544
2556
|
case 1:
|
|
2545
2557
|
response = _state.sent();
|
|
2546
2558
|
stream = new ReadableStream({
|
|
2547
2559
|
start: function start(controller) {
|
|
2548
2560
|
return _async_to_generator(function() {
|
|
2549
|
-
var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, chunk, err;
|
|
2561
|
+
var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, chunk, resultChunk, newChoices, err;
|
|
2550
2562
|
return _ts_generator(this, function(_state) {
|
|
2551
2563
|
switch(_state.label){
|
|
2552
2564
|
case 0:
|
|
@@ -2573,7 +2585,34 @@ var post7 = function(param) {
|
|
|
2573
2585
|
];
|
|
2574
2586
|
_value = _step.value;
|
|
2575
2587
|
chunk = _value;
|
|
2576
|
-
|
|
2588
|
+
resultChunk = void 0;
|
|
2589
|
+
if (chunk.choices) {
|
|
2590
|
+
newChoices = chunk.choices.map(function(choice) {
|
|
2591
|
+
var _choice_delta;
|
|
2592
|
+
if ((_choice_delta = choice.delta) === null || _choice_delta === void 0 ? void 0 : _choice_delta.tool_calls) {
|
|
2593
|
+
return _object_spread_props(_object_spread({}, choice), {
|
|
2594
|
+
delta: _object_spread_props(_object_spread({}, choice.delta), {
|
|
2595
|
+
tool_calls: choice.delta.tool_calls.map(function(toolCall) {
|
|
2596
|
+
if (toolCall.id === "") {
|
|
2597
|
+
return _object_spread_props(_object_spread({}, toolCall), {
|
|
2598
|
+
id: "call_".concat((0, import_cuid2.createId)())
|
|
2599
|
+
});
|
|
2600
|
+
}
|
|
2601
|
+
return toolCall;
|
|
2602
|
+
})
|
|
2603
|
+
})
|
|
2604
|
+
});
|
|
2605
|
+
} else {
|
|
2606
|
+
return choice;
|
|
2607
|
+
}
|
|
2608
|
+
});
|
|
2609
|
+
resultChunk = _object_spread_props(_object_spread({}, chunk), {
|
|
2610
|
+
choices: newChoices
|
|
2611
|
+
});
|
|
2612
|
+
} else {
|
|
2613
|
+
resultChunk = chunk;
|
|
2614
|
+
}
|
|
2615
|
+
controller.enqueue("data: ".concat(JSON.stringify(resultChunk), "\n\n"));
|
|
2577
2616
|
_state.label = 4;
|
|
2578
2617
|
case 4:
|
|
2579
2618
|
_iteratorAbruptCompletion = false;
|
|
@@ -2655,7 +2694,7 @@ var post7 = function(param) {
|
|
|
2655
2694
|
]);
|
|
2656
2695
|
return [
|
|
2657
2696
|
4,
|
|
2658
|
-
google.chat.completions.create(
|
|
2697
|
+
google.chat.completions.create(resultOptions)
|
|
2659
2698
|
];
|
|
2660
2699
|
case 3:
|
|
2661
2700
|
data = _state.sent();
|