Skip to content

Commit

Permalink
feat: upgrade Bing Chat brand to Copilot
Browse files Browse the repository at this point in the history
  • Loading branch information
sunner committed Jan 31, 2024
1 parent df05c6b commit 3d1c1d6
Show file tree
Hide file tree
Showing 19 changed files with 68 additions and 67 deletions.
Binary file modified public/bots/bing-balanced-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/bots/bing-creative-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/bots/bing-precise-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,9 @@ async function createWindow() {
requestHeaders["sec-fetch-site"] = "same-origin";
}

// To make Bing Chat work
// To make Copilot work
if (url.startsWith("wss://sydney.bing.com/")) {
requestHeaders["Origin"] = "https://www.bing.com";
requestHeaders["Origin"] = "https://copilot.microsoft.com";
}

callback({ requestHeaders });
Expand Down
11 changes: 4 additions & 7 deletions src/bots/microsoft/BingChatBalancedBot.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,15 @@ export default class BingChatBalancedBot extends BingChatBot {
"responsible_ai_policy_235",
"enablemm",
"dv3sugg",
"machine_affinity",
"autosave",
"iyxapbing",
"iycapbing",
"galileo",
"bicfluxv2",
"memmidlat",
"langdtwb",
"014CB21D",
"saharagenconv5",
"fluxhint",
"glfluxv13",
"adsredirecturl",
"agicert",
"iypapyrus",
"eredirecturl",
];
static _tone = "Balanced";

Expand Down
54 changes: 28 additions & 26 deletions src/bots/microsoft/BingChatBot.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ export default class BingChatBot extends Bot {
static _className = "BingChatBot"; // Class name of the bot
static _model = "h3precise"; // Bing styles: h3imaginative, harmonyv3, h3precise
static _logoFilename = "bing-logo.svg"; // Place it in public/bots/
static _loginUrl = "https://www.bing.com/chat";
static _userAgent =
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.48";

static _loginUrl = "https://copilot.microsoft.com/";
static _optionsSets = null; // Set by the subclass
static _tone = ""; // Set by the subclass

Expand All @@ -24,12 +21,12 @@ export default class BingChatBot extends Bot {
const headers = {
"x-ms-client-request-id": uuidv4(),
"x-ms-useragent":
"azsdk-js-api-client-factory/1.0.0-beta.1 core-rest-pipeline/1.10.3 OS/macOS",
"azsdk-js-api-client-factory/1.0.0-beta.1 core-rest-pipeline/1.12.3 OS/macOS",
};
let conversation = null;

const response = await axios.get(
"https://www.bing.com/turing/conversation/create",
"https://copilot.microsoft.com/turing/conversation/create",
{ headers },
);
if (response.status == 200 && response.data?.result?.value == "Success") {
Expand All @@ -45,7 +42,7 @@ export default class BingChatBot extends Bot {
invocationId: 0,
};
} else {
console.error("Error creating Bing Chat conversation:", response);
console.error("Error creating Copilot conversation:", response);
throw new Error(
i18n.global.t("bot.failedToCreateConversation") + " " + response.data,
);
Expand All @@ -58,7 +55,7 @@ export default class BingChatBot extends Bot {
let available = false;

await axios
.get("https://www.bing.com/turing/conversation/chats")
.get("https://copilot.microsoft.com/turing/conversation/chats")
.then((response) => {
available =
response.data?.result?.value == "Success" &&
Expand All @@ -71,7 +68,7 @@ export default class BingChatBot extends Bot {
}
})
.catch((error) => {
console.error("Error checking Bing Chat login status:", error);
console.error("Error checking Copilot login status:", error);
});

return available;
Expand All @@ -87,21 +84,26 @@ export default class BingChatBot extends Bot {
optionsSets: this.constructor._optionsSets,
allowedMessageTypes: ["Chat", "InternalSearchQuery"],
sliceIds: [
"629adsredir",
"gbaa",
"gba",
"divkorbl2p",
"emovoicecf",
"tts3cf",
"crtrgxnew",
"wrapuxslimt",
"norbingchrome",
"sydconfigoptt",
"803iyjbexps0",
"178gentechs0",
"824fluxhi52s0",
"0825agicert",
"821iypapyrust",
"tnamobcf",
"adssqovr",
"inlineadsv2",
"inlineadscont",
"1542",
"1211enbackfix",
"cmcallcf",
"ctvismctrl",
"sydtransview",
"exptonecf",
"bgstream",
"abv2cl",
"1215persc",
"0212boptpsc",
"14bicfluxv2",
"111mem",
"116langwb",
"0124dv1s0",
"0126hpctas0",
"1pgptwdess0",
],
verbosity: "verbose",
scenario: "SERP",
Expand Down Expand Up @@ -178,7 +180,7 @@ export default class BingChatBot extends Bot {
resolve();
} else if (event.type === 2) {
if (event.item.result.value !== "Success") {
console.error("Error sending prompt to Bing Chat:", event);
console.error("Error sending prompt to Copilot:", event);
if (event.item.result.value === "InvalidSession") {
// Create a new conversation and retry
context = await this.createChatContext();
Expand Down Expand Up @@ -244,7 +246,7 @@ export default class BingChatBot extends Bot {
wsp.close();
reject(new Error(event.error));
} else {
console.warn("Unknown Bing Chat response:", event);
console.warn("Unknown Copilot response:", event);
}
}
} catch (error) {
Expand Down
11 changes: 6 additions & 5 deletions src/bots/microsoft/BingChatCreativeBot.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ export default class BingChatCreativeBot extends BingChatBot {
"responsible_ai_policy_235",
"enablemm",
"dv3sugg",
"machine_affinity",
"autosave",
"iyxapbing",
"iycapbing",
"enable_user_consent",
"fluxmemcst",
"h3imaginative",
"adsredirecturl",
"agicert",
"iypapyrus",
"eredirecturl",
"bicfluxv2",
"memmidlat",
"langdtwb",
"014CB21D",
"clgalileo",
"gencontentv3",
];
Expand Down
11 changes: 6 additions & 5 deletions src/bots/microsoft/BingChatPreciseBot.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,18 @@ export default class BingChatPreciseBot extends BingChatBot {
"responsible_ai_policy_235",
"enablemm",
"dv3sugg",
"machine_affinity",
"autosave",
"iyxapbing",
"iycapbing",
"h3precise",
"bicfluxv2",
"memmidlat",
"langdtwb",
"014CB21D",
"clgalileo",
"gencontentv3",
"adsredirecturl",
"agicert",
"iypapyrus",
"eredirecturl",
"fluxmemcst",
"enable_user_consent",
];
static _tone = "Precise";

Expand Down
2 changes: 1 addition & 1 deletion src/components/ChatSetting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ const userActions = computed(() => {
});
const previewSampleData = [
{
botName: "Bing Chat (Creative)",
botName: "Copilot (Creative)",
botResponse: "Hello, this is Bing. How are you today? 😊",
},
{
Expand Down
4 changes: 2 additions & 2 deletions src/i18n/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"topPPrompt": "Token werden vom wahrscheinlichsten bis zum am wenigsten wahrscheinlichen ausgewählt, bis die Summe ihrer Wahrscheinlichkeiten den topP-Wert ergibt."
},
"bingChat": {
"name": "Bing Chat",
"name": "Copilot",
"h3imaginative": "Kreativ",
"galileo": "Ausgewogen",
"h3precise": "Präzise"
Expand Down Expand Up @@ -105,4 +105,4 @@
"dev": {
"name": "Dev Bot"
}
}
}
2 changes: 1 addition & 1 deletion src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"name": "Bard"
},
"bingChat": {
"name": "Bing Chat",
"name": "Copilot",
"solveCaptcha": "You need to <a { attributes }>solve CAPTCHA</a> to continue.",
"h3imaginative": "Creative",
"galileo": "Balanced",
Expand Down
4 changes: 2 additions & 2 deletions src/i18n/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"name": "Bardo"
},
"bingChat": {
"name": "Bing Chat",
"name": "Copilot",
"solveCaptcha": "Necesitas <a {=\"\" attributes=\"\" }=\"\">resolver CAPTCHA</a> para continuar.",
"h3imaginative": "Creativo",
"galileo": "Equilibrado",
Expand Down Expand Up @@ -265,4 +265,4 @@
"clear": "Claro"
}
}
}
}
4 changes: 2 additions & 2 deletions src/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"name": "Bard"
},
"bingChat": {
"name": "Bing Chat",
"name": "Copilot",
"h3imaginative": "Créatif",
"galileo": "Équilibré",
"h3precise": "Précis"
Expand Down Expand Up @@ -109,4 +109,4 @@
"dev": {
"name": "Bot Dev"
}
}
}
4 changes: 2 additions & 2 deletions src/i18n/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"name": "Bard"
},
"bingChat": {
"name": "Bing Chat",
"name": "Copilot",
"h3imaginative": "Creativo",
"galileo": "Equilibrato",
"h3precise": "Preciso"
Expand Down Expand Up @@ -116,4 +116,4 @@
"dev": {
"name": "Bot Dev"
}
}
}
4 changes: 2 additions & 2 deletions src/i18n/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"name": "Bard"
},
"bingChat": {
"name": "Bing Chat",
"name": "Copilot",
"solveCaptcha": "続行するには <a { attributes }>CAPTCHA認証/a>をしてください。",
"h3imaginative": "創造的に",
"galileo": "バランスよく",
Expand Down Expand Up @@ -222,4 +222,4 @@
"saveAndActiveMessage": "プロキシ設定を適用するにはChatALLを再起動する必要があります。よろしいですか?",
"googleService": "Google Service"
}
}
}
4 changes: 2 additions & 2 deletions src/i18n/locales/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"name": "Bard"
},
"bingChat": {
"name": "Bing Chat",
"name": "Copilot",
"solveCaptcha": "계속하려면 <a { attributes }>CAPTCHA를 해결</a>해야 합니다.",
"h3imaginative": "창의적인",
"galileo": "균형 있는",
Expand Down Expand Up @@ -333,4 +333,4 @@
"25": "25",
"50": "50",
"100": "100"
}
}
4 changes: 2 additions & 2 deletions src/i18n/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"name": "Bard"
},
"bingChat": {
"name": "Bing Chat",
"name": "Copilot",
"h3imaginative": "Творческий",
"galileo": "Сбалансированный",
"h3precise": "Точный"
Expand Down Expand Up @@ -108,4 +108,4 @@
"dev": {
"name": "Dev Bot"
}
}
}
10 changes: 5 additions & 5 deletions src/i18n/locales/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"done": "Xong",
"cancel": "Hủy"
},
"chat": {
"chat": {
"name": "Hội thoại",
"newChat": "Hội thoại mới",
"deleteAllChatHistory": "Xóa tất cả lịch sử hội thoại",
Expand Down Expand Up @@ -115,7 +115,7 @@
"name": "Bard"
},
"bingChat": {
"name": "Bing Chat",
"name": "Copilot",
"solveCaptcha": "Vui lòng giải captcha để tiếp tục: <a { attributes }>solve CAPTCHA</a>",
"h3imaginative": "Sáng tạo",
"galileo": "Cân bằng",
Expand Down Expand Up @@ -199,7 +199,7 @@
"temperature2": "Tự nhiên hơn",
"apiKey": "API Key"
},
"poe": {
"poe": {
"name": "Poe",
"a2": "Claude-instant",
"a2_100k": "Claude-instant-100k",
Expand Down Expand Up @@ -227,7 +227,7 @@
"ERNIE-Bot-turbo": "ERNIE-Bot-turbo",
"ERNIE-Bot-4": "ERNIE-Bot-4"
},
"youChat": {
"youChat": {
"name": "YouChat"
},
"chatGlm": {
Expand Down Expand Up @@ -273,7 +273,7 @@
"matchCase": "Trường hợp phù hợp",
"wrapAround": "Quay lại đầu"
},
"proxy": {
"proxy": {
"name": "Proxy",
"address": "Proxy Server Address",
"addressExample": "http://127.0.0.1:7890, socks5://127.0.0.1:1080",
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"name": "Bard"
},
"bingChat": {
"name": "必应对话",
"name": "Copilot",
"solveCaptcha": "你需要<a { attributes }>通过真人验证</a>才能继续。",
"h3imaginative": "创造力",
"galileo": "平衡",
Expand Down

0 comments on commit 3d1c1d6

Please sign in to comment.