Skip to content

Commit fff7184

Browse files
committed
mods to use env vars
1 parent d5ba415 commit fff7184

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

copilot-language-server/dist/language-server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ if (err !== undefined) {
2020
process.exit(minNodeVersion);
2121
}
2222

23-
require('./main').main();
23+
require('./main.prettier').main();

copilot-language-server/dist/main.prettier.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116067,7 +116067,7 @@ var Er = class {
116067116067
}
116068116068
};
116069116069
function Jv(t, e, r, n, o, s, c, l, u, d) {
116070-
let p = { ...l, Authorization: `Bearer ${r}`, ...N0(t) };
116070+
let p = { ...l, Authorization: `Bearer ${process.env.OPENROUTER_API_KEY || r}`, ...N0(t) };
116071116071
(d === void 0 &&
116072116072
((p["Openai-Organization"] = "github-copilot"),
116073116073
(p["X-Request-Id"] = o),
@@ -130121,6 +130121,7 @@ var Jh = class extends Ls {
130121130121
));
130122130122
}
130123130123
get quotaExhausted() {
130124+
if (process.env.OPENROUTER_API_KEY) return !1;
130124130125
return this._quotaInfo
130125130126
? this._quotaInfo.used >= this._quotaInfo.quota &&
130126130127
!this._quotaInfo.overageEnabled
@@ -140325,7 +140326,7 @@ var Eer = "github.copilot.completions.quotaExceeded",
140325140326
}
140326140327
async fetchAndStreamChat(e, r, n, o, s, c, l, u = {}, d) {
140327140328
if (this.#e) return { type: "canceled", reason: this.#e };
140328-
let p = "https://copilot-proxy.githubusercontent.com/chat/completions",
140329+
let p = process.env.COPILOT_BASE_URL || "https://copilot-proxy.githubusercontent.com/chat/completions",
140329140330
m = { messages: r, model: l.id, stream: !0, ...u },
140330140331
h = n.extendedBy({ endpoint: p, model: l.name }),
140331140332
g = e.get(Wi),

0 commit comments

Comments
 (0)