:zap: [Enhance] Update cors proxy server, and working on bingo
Browse files- js/llm_models_loader.js +3 -3
- js/llm_requester.js +14 -2
js/llm_models_loader.js
CHANGED
@@ -11,9 +11,9 @@ export async function setup_available_models_on_select(default_option = null) {
|
|
11 |
// "bing-dall-e", // not work
|
12 |
// "bing-gpt-4", // not work
|
13 |
// "bing-gpt-4-32k", // not work
|
14 |
-
// "bingo-
|
15 |
-
// "bingo-
|
16 |
-
// "bingo-
|
17 |
"claude-2",
|
18 |
"gpt-3.5-turbo",
|
19 |
"gpt-3.5-turbo-internet",
|
|
|
11 |
// "bing-dall-e", // not work
|
12 |
// "bing-gpt-4", // not work
|
13 |
// "bing-gpt-4-32k", // not work
|
14 |
+
// "bingo-precise", // in progress
|
15 |
+
// "bingo-balanced", // in progress
|
16 |
+
// "bingo-creative", // in progress
|
17 |
"claude-2",
|
18 |
"gpt-3.5-turbo",
|
19 |
"gpt-3.5-turbo-internet",
|
js/llm_requester.js
CHANGED
@@ -31,11 +31,23 @@ export class ChatCompletionsRequester {
|
|
31 |
this.model = model || get_selected_llm_model() || "gpt-turbo-3.5";
|
32 |
this.temperature =
|
33 |
temperature !== null ? temperature : get_selected_temperature();
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
if (cors_proxy !== null) {
|
36 |
this.cors_proxy = cors_proxy;
|
37 |
} else if (window.location.protocol === "https:") {
|
38 |
-
this.cors_proxy = "https://hansimov-cors
|
39 |
} else {
|
40 |
this.cors_proxy = "https://cors-anywhere.herokuapp.com/";
|
41 |
}
|
|
|
31 |
this.model = model || get_selected_llm_model() || "gpt-turbo-3.5";
|
32 |
this.temperature =
|
33 |
temperature !== null ? temperature : get_selected_temperature();
|
34 |
+
|
35 |
+
if (this.model.startsWith("bingo")) {
|
36 |
+
// if this.model is `bingo-precise`, then:
|
37 |
+
// - this.endpoint: `https://copilot.github1s.tk/api/v1`
|
38 |
+
// - this.model: `Precise`
|
39 |
+
this.endpoint = "https://copilot.github1s.tk";
|
40 |
+
this.mode = this.model.split("-")[1];
|
41 |
+
this.model =
|
42 |
+
this.mode.charAt(0).toUpperCase() +
|
43 |
+
this.mode.slice(1).toLowerCase();
|
44 |
+
} else {
|
45 |
+
this.endpoint = endpoint || localStorage.getItem("openai_endpoint");
|
46 |
+
}
|
47 |
if (cors_proxy !== null) {
|
48 |
this.cors_proxy = cors_proxy;
|
49 |
} else if (window.location.protocol === "https:") {
|
50 |
+
this.cors_proxy = "https://hansimov-cors.onrender.com/";
|
51 |
} else {
|
52 |
this.cors_proxy = "https://cors-anywhere.herokuapp.com/";
|
53 |
}
|