@dianshuv/copilot-api 0.7.0 → 0.7.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/main.mjs +15 -13
- package/package.json +1 -1
package/dist/main.mjs
CHANGED
|
@@ -1213,7 +1213,7 @@ const patchClaude = defineCommand({
|
|
|
1213
1213
|
|
|
1214
1214
|
//#endregion
|
|
1215
1215
|
//#region package.json
|
|
1216
|
-
var version = "0.7.
|
|
1216
|
+
var version = "0.7.1";
|
|
1217
1217
|
|
|
1218
1218
|
//#endregion
|
|
1219
1219
|
//#region src/lib/adaptive-rate-limiter.ts
|
|
@@ -4587,25 +4587,27 @@ function handleNonStreamResponse(c, response, model, ctx, payload) {
|
|
|
4587
4587
|
//#endregion
|
|
4588
4588
|
//#region src/routes/gemini/model-alias.ts
|
|
4589
4589
|
/**
|
|
4590
|
-
* Maps Gemini model names
|
|
4591
|
-
* to equivalent models that are.
|
|
4590
|
+
* Maps Gemini model names to equivalent models available on GitHub Copilot.
|
|
4592
4591
|
*
|
|
4593
|
-
*
|
|
4594
|
-
* and gemini-2.5-flash, which Copilot doesn't serve. We map them to
|
|
4595
|
-
* the closest available flash model.
|
|
4592
|
+
* Two types of aliases:
|
|
4596
4593
|
*
|
|
4597
|
-
*
|
|
4598
|
-
* the
|
|
4599
|
-
*
|
|
4594
|
+
* - **Forced**: Always applied regardless of Copilot model availability.
|
|
4595
|
+
* Use when the old model name should never reach the backend.
|
|
4596
|
+
*
|
|
4597
|
+
* - **Conditional**: Only applied when the requested model is absent from
|
|
4598
|
+
* the Copilot model list, so if Copilot adds native support the request
|
|
4599
|
+
* goes through unchanged.
|
|
4600
4600
|
*/
|
|
4601
|
-
const
|
|
4601
|
+
const GEMINI_FORCED_ALIASES = { "gemini-2.5-pro": "gemini-3.1-pro-preview" };
|
|
4602
|
+
const GEMINI_CONDITIONAL_ALIASES = {
|
|
4602
4603
|
"gemini-2.5-flash-lite": "gemini-3-flash-preview",
|
|
4603
4604
|
"gemini-2.5-flash": "gemini-3-flash-preview"
|
|
4604
4605
|
};
|
|
4605
4606
|
function resolveGeminiModelAlias(model) {
|
|
4606
|
-
if (
|
|
4607
|
-
if (
|
|
4608
|
-
return
|
|
4607
|
+
if (model in GEMINI_FORCED_ALIASES) return GEMINI_FORCED_ALIASES[model];
|
|
4608
|
+
if (!(model in GEMINI_CONDITIONAL_ALIASES)) return model;
|
|
4609
|
+
if (findModelById(model)) return model;
|
|
4610
|
+
return GEMINI_CONDITIONAL_ALIASES[model];
|
|
4609
4611
|
}
|
|
4610
4612
|
|
|
4611
4613
|
//#endregion
|