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