🧹 chore: Remove Deprecated BingAI Code & Address Mobile Focus (#5565)

* chore: remove all bing code

* chore: remove bing code and auto-focus effects

* chore: add back escapeRegExp helper function for regex special character handling

* chore: remove deprecated fields from settings and conversation schema

* fix: ensure default endpoint is set correctly in conversation setup

* feat: add disableFocus option to newConversation for improved search behavior
This commit is contained in:
Danny Avila 2025-01-30 17:22:29 -05:00 committed by GitHub
parent 1226f56d0c
commit 19fa4d9f54
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
52 changed files with 52 additions and 1384 deletions

View file

@ -596,7 +596,6 @@ export const defaultEndpoints: EModelEndpoint[] = [
EModelEndpoint.azureAssistants,
EModelEndpoint.azureOpenAI,
EModelEndpoint.agents,
EModelEndpoint.bingAI,
EModelEndpoint.chatGPTBrowser,
EModelEndpoint.gptPlugins,
EModelEndpoint.google,
@ -611,7 +610,6 @@ export const alternateName = {
[EModelEndpoint.agents]: 'Agents',
[EModelEndpoint.azureAssistants]: 'Azure Assistants',
[EModelEndpoint.azureOpenAI]: 'Azure OpenAI',
[EModelEndpoint.bingAI]: 'Bing',
[EModelEndpoint.chatGPTBrowser]: 'ChatGPT',
[EModelEndpoint.gptPlugins]: 'Plugins',
[EModelEndpoint.google]: 'Google',
@ -735,7 +733,6 @@ export const initialModelsConfig: TModelsConfig = {
[EModelEndpoint.agents]: openAIModels, // TODO: Add agent models (agentsModels)
[EModelEndpoint.gptPlugins]: openAIModels,
[EModelEndpoint.azureOpenAI]: openAIModels,
[EModelEndpoint.bingAI]: ['BingAI', 'Sydney'],
[EModelEndpoint.chatGPTBrowser]: ['text-davinci-002-render-sha'],
[EModelEndpoint.google]: defaultModels[EModelEndpoint.google],
[EModelEndpoint.anthropic]: defaultModels[EModelEndpoint.anthropic],
@ -744,7 +741,6 @@ export const initialModelsConfig: TModelsConfig = {
export const EndpointURLs: { [key in EModelEndpoint]: string } = {
[EModelEndpoint.openAI]: `/api/ask/${EModelEndpoint.openAI}`,
[EModelEndpoint.bingAI]: `/api/ask/${EModelEndpoint.bingAI}`,
[EModelEndpoint.google]: `/api/ask/${EModelEndpoint.google}`,
[EModelEndpoint.custom]: `/api/ask/${EModelEndpoint.custom}`,
[EModelEndpoint.anthropic]: `/api/ask/${EModelEndpoint.anthropic}`,
@ -1163,8 +1159,6 @@ export enum LocalStorageKeys {
APP_TITLE = 'appTitle',
/** Key for the last conversation setup. */
LAST_CONVO_SETUP = 'lastConversationSetup',
/** Key for the last BingAI Settings */
LAST_BING = 'lastBingSettings',
/** Key for the last selected model. */
LAST_MODEL = 'lastSelectedModel',
/** Key for the last selected tools. */

View file

@ -6,7 +6,6 @@ import { ContentTypes } from './types/runs';
import {
openAISchema,
googleSchema,
bingAISchema,
EModelEndpoint,
anthropicSchema,
assistantSchema,
@ -25,7 +24,6 @@ import { alternateName } from './config';
type EndpointSchema =
| typeof openAISchema
| typeof googleSchema
| typeof bingAISchema
| typeof anthropicSchema
| typeof chatGPTBrowserSchema
| typeof gptPluginsSchema
@ -38,7 +36,6 @@ const endpointSchemas: Record<EModelEndpoint, EndpointSchema> = {
[EModelEndpoint.azureOpenAI]: openAISchema,
[EModelEndpoint.custom]: openAISchema,
[EModelEndpoint.google]: googleSchema,
[EModelEndpoint.bingAI]: bingAISchema,
[EModelEndpoint.anthropic]: anthropicSchema,
[EModelEndpoint.chatGPTBrowser]: chatGPTBrowserSchema,
[EModelEndpoint.gptPlugins]: gptPluginsSchema,
@ -61,7 +58,6 @@ export function getEnabledEndpoints() {
EModelEndpoint.azureAssistants,
EModelEndpoint.azureOpenAI,
EModelEndpoint.google,
EModelEndpoint.bingAI,
EModelEndpoint.chatGPTBrowser,
EModelEndpoint.gptPlugins,
EModelEndpoint.anthropic,
@ -223,7 +219,6 @@ export const getResponseSender = (endpointOption: t.TEndpointOption): string =>
modelDisplayLabel: _mdl,
chatGptLabel: _cgl,
modelLabel: _ml,
jailbreak,
} = endpointOption;
const model = _m ?? '';
@ -257,10 +252,6 @@ export const getResponseSender = (endpointOption: t.TEndpointOption): string =>
return (alternateName[endpoint] as string | undefined) ?? 'ChatGPT';
}
if (endpoint === EModelEndpoint.bingAI) {
return jailbreak === true ? 'Sydney' : 'BingAI';
}
if (endpoint === EModelEndpoint.anthropic) {
return modelLabel || 'Claude';
}
@ -309,7 +300,6 @@ type CompactEndpointSchema =
| typeof compactAssistantSchema
| typeof compactAgentsSchema
| typeof compactGoogleSchema
| typeof bingAISchema
| typeof anthropicSchema
| typeof compactChatGPTSchema
| typeof bedrockInputSchema
@ -324,8 +314,6 @@ const compactEndpointSchemas: Record<string, CompactEndpointSchema> = {
[EModelEndpoint.agents]: compactAgentsSchema,
[EModelEndpoint.google]: compactGoogleSchema,
[EModelEndpoint.bedrock]: bedrockInputSchema,
/* BingAI needs all fields */
[EModelEndpoint.bingAI]: bingAISchema,
[EModelEndpoint.anthropic]: anthropicSchema,
[EModelEndpoint.chatGPTBrowser]: compactChatGPTSchema,
[EModelEndpoint.gptPlugins]: compactPluginsSchema,

View file

@ -24,8 +24,6 @@ export enum EModelEndpoint {
custom = 'custom',
bedrock = 'bedrock',
/** @deprecated */
bingAI = 'bingAI',
/** @deprecated */
chatGPTBrowser = 'chatGPTBrowser',
/** @deprecated */
gptPlugins = 'gptPlugins',
@ -592,25 +590,6 @@ export const tConversationSchema = z.object({
greeting: z.string().optional(),
spec: z.string().nullable().optional(),
iconURL: z.string().nullable().optional(),
/*
Deprecated fields
*/
/** @deprecated */
suggestions: z.array(z.string()).optional(),
/** @deprecated */
systemMessage: z.string().nullable().optional(),
/** @deprecated */
jailbreak: z.boolean().optional(),
/** @deprecated */
jailbreakConversationId: z.string().nullable().optional(),
/** @deprecated */
conversationSignature: z.string().nullable().optional(),
/** @deprecated */
clientId: z.string().nullable().optional(),
/** @deprecated */
invocationId: z.number().nullable().optional(),
/** @deprecated */
toneStyle: z.string().nullable().optional(),
/** @deprecated */
resendImages: z.boolean().optional(),
/** @deprecated */
@ -816,41 +795,6 @@ export const googleGenConfigSchema = z
.strip()
.optional();
export const bingAISchema = tConversationSchema
.pick({
jailbreak: true,
systemMessage: true,
context: true,
toneStyle: true,
jailbreakConversationId: true,
conversationSignature: true,
clientId: true,
invocationId: true,
})
.transform((obj) => ({
...obj,
model: '',
jailbreak: obj.jailbreak ?? false,
systemMessage: obj.systemMessage ?? null,
context: obj.context ?? null,
toneStyle: obj.toneStyle ?? 'creative',
jailbreakConversationId: obj.jailbreakConversationId ?? null,
conversationSignature: obj.conversationSignature ?? null,
clientId: obj.clientId ?? null,
invocationId: obj.invocationId ?? 1,
}))
.catch(() => ({
model: '',
jailbreak: false,
systemMessage: null,
context: null,
toneStyle: 'creative',
jailbreakConversationId: null,
conversationSignature: null,
clientId: null,
invocationId: 1,
}));
export const chatGPTBrowserSchema = tConversationSchema
.pick({
model: true,