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.js
CHANGED
|
@@ -2354,10 +2354,11 @@ var togetherClientAdapter = function(param) {
|
|
|
2354
2354
|
// src/adapters/client/googleClientAdapter/models/get.ts
|
|
2355
2355
|
var models9 = [
|
|
2356
2356
|
"gemini-2.0-flash-exp",
|
|
2357
|
+
"gemini-2.0-flash",
|
|
2358
|
+
"gemini-2.0-flash-lite-preview-02-05",
|
|
2357
2359
|
"gemini-1.5-flash",
|
|
2358
2360
|
"gemini-1.5-flash-8b",
|
|
2359
2361
|
"gemini-1.5-pro",
|
|
2360
|
-
"gemini-1.0-pro",
|
|
2361
2362
|
"text-embedding-004",
|
|
2362
2363
|
"aqa"
|
|
2363
2364
|
];
|
|
@@ -2417,29 +2418,35 @@ var models10 = function(param) {
|
|
|
2417
2418
|
};
|
|
2418
2419
|
};
|
|
2419
2420
|
// src/adapters/client/googleClientAdapter/completions/post.ts
|
|
2421
|
+
import { createId } from "@paralleldrive/cuid2";
|
|
2420
2422
|
var post7 = function(param) {
|
|
2421
2423
|
var google = param.google;
|
|
2422
2424
|
return /*#__PURE__*/ function() {
|
|
2423
2425
|
var _ref = _async_to_generator(function(_url, options) {
|
|
2424
|
-
var body, response, stream, data, error;
|
|
2426
|
+
var body, resultOptions, response, stream, data, error;
|
|
2425
2427
|
return _ts_generator(this, function(_state) {
|
|
2426
2428
|
switch(_state.label){
|
|
2427
2429
|
case 0:
|
|
2428
2430
|
body = JSON.parse(options.body);
|
|
2431
|
+
resultOptions = _object_spread_props(_object_spread({}, body), {
|
|
2432
|
+
messages: nonEmptyMessages({
|
|
2433
|
+
messages: body.messages
|
|
2434
|
+
})
|
|
2435
|
+
});
|
|
2429
2436
|
if (!body.stream) return [
|
|
2430
2437
|
3,
|
|
2431
2438
|
2
|
|
2432
2439
|
];
|
|
2433
2440
|
return [
|
|
2434
2441
|
4,
|
|
2435
|
-
google.chat.completions.create(
|
|
2442
|
+
google.chat.completions.create(resultOptions)
|
|
2436
2443
|
];
|
|
2437
2444
|
case 1:
|
|
2438
2445
|
response = _state.sent();
|
|
2439
2446
|
stream = new ReadableStream({
|
|
2440
2447
|
start: function start(controller) {
|
|
2441
2448
|
return _async_to_generator(function() {
|
|
2442
|
-
var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, chunk, err;
|
|
2449
|
+
var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, chunk, resultChunk, newChoices, err;
|
|
2443
2450
|
return _ts_generator(this, function(_state) {
|
|
2444
2451
|
switch(_state.label){
|
|
2445
2452
|
case 0:
|
|
@@ -2466,7 +2473,34 @@ var post7 = function(param) {
|
|
|
2466
2473
|
];
|
|
2467
2474
|
_value = _step.value;
|
|
2468
2475
|
chunk = _value;
|
|
2469
|
-
|
|
2476
|
+
resultChunk = void 0;
|
|
2477
|
+
if (chunk.choices) {
|
|
2478
|
+
newChoices = chunk.choices.map(function(choice) {
|
|
2479
|
+
var _choice_delta;
|
|
2480
|
+
if ((_choice_delta = choice.delta) === null || _choice_delta === void 0 ? void 0 : _choice_delta.tool_calls) {
|
|
2481
|
+
return _object_spread_props(_object_spread({}, choice), {
|
|
2482
|
+
delta: _object_spread_props(_object_spread({}, choice.delta), {
|
|
2483
|
+
tool_calls: choice.delta.tool_calls.map(function(toolCall) {
|
|
2484
|
+
if (toolCall.id === "") {
|
|
2485
|
+
return _object_spread_props(_object_spread({}, toolCall), {
|
|
2486
|
+
id: "call_".concat(createId())
|
|
2487
|
+
});
|
|
2488
|
+
}
|
|
2489
|
+
return toolCall;
|
|
2490
|
+
})
|
|
2491
|
+
})
|
|
2492
|
+
});
|
|
2493
|
+
} else {
|
|
2494
|
+
return choice;
|
|
2495
|
+
}
|
|
2496
|
+
});
|
|
2497
|
+
resultChunk = _object_spread_props(_object_spread({}, chunk), {
|
|
2498
|
+
choices: newChoices
|
|
2499
|
+
});
|
|
2500
|
+
} else {
|
|
2501
|
+
resultChunk = chunk;
|
|
2502
|
+
}
|
|
2503
|
+
controller.enqueue("data: ".concat(JSON.stringify(resultChunk), "\n\n"));
|
|
2470
2504
|
_state.label = 4;
|
|
2471
2505
|
case 4:
|
|
2472
2506
|
_iteratorAbruptCompletion = false;
|
|
@@ -2548,7 +2582,7 @@ var post7 = function(param) {
|
|
|
2548
2582
|
]);
|
|
2549
2583
|
return [
|
|
2550
2584
|
4,
|
|
2551
|
-
google.chat.completions.create(
|
|
2585
|
+
google.chat.completions.create(resultOptions)
|
|
2552
2586
|
];
|
|
2553
2587
|
case 3:
|
|
2554
2588
|
data = _state.sent();
|