🧹 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

@ -53,7 +53,7 @@ DEBUG_CONSOLE=false
# Endpoints # # Endpoints #
#===================================================# #===================================================#
# ENDPOINTS=openAI,assistants,azureOpenAI,bingAI,google,gptPlugins,anthropic # ENDPOINTS=openAI,assistants,azureOpenAI,google,gptPlugins,anthropic
PROXY= PROXY=
@ -105,13 +105,6 @@ ANTHROPIC_API_KEY=user_provided
# AZURE_OPENAI_API_EMBEDDINGS_DEPLOYMENT_NAME= # Deprecated # AZURE_OPENAI_API_EMBEDDINGS_DEPLOYMENT_NAME= # Deprecated
# PLUGINS_USE_AZURE="true" # Deprecated # PLUGINS_USE_AZURE="true" # Deprecated
#============#
# BingAI #
#============#
BINGAI_TOKEN=user_provided
# BINGAI_HOST=https://cn.bing.com
#=================# #=================#
# AWS Bedrock # # AWS Bedrock #
#=================# #=================#

View file

@ -3,15 +3,6 @@ const cleanUpPrimaryKeyValue = (value) => {
return value.replace(/--/g, '|'); return value.replace(/--/g, '|');
}; };
function replaceSup(text) {
if (!text.includes('<sup>')) {
return text;
}
const replacedText = text.replace(/<sup>/g, '^').replace(/\s+<\/sup>/g, '^');
return replacedText;
}
module.exports = { module.exports = {
cleanUpPrimaryKeyValue, cleanUpPrimaryKeyValue,
replaceSup,
}; };

View file

@ -29,22 +29,6 @@ const convoSchema = mongoose.Schema(
agent_id: { agent_id: {
type: String, type: String,
}, },
// for bingAI only
bingConversationId: {
type: String,
},
jailbreakConversationId: {
type: String,
},
conversationSignature: {
type: String,
},
clientId: {
type: String,
},
invocationId: {
type: Number,
},
tags: { tags: {
type: [String], type: [String],
default: [], default: [],

View file

@ -1,5 +1,5 @@
const conversationPreset = { const conversationPreset = {
// endpoint: [azureOpenAI, openAI, bingAI, anthropic, chatGPTBrowser] // endpoint: [azureOpenAI, openAI, anthropic, chatGPTBrowser]
endpoint: { endpoint: {
type: String, type: String,
default: null, default: null,
@ -61,19 +61,6 @@ const conversationPreset = {
type: Number, type: Number,
required: false, required: false,
}, },
// for bingai only
jailbreak: {
type: Boolean,
},
context: {
type: String,
},
systemMessage: {
type: String,
},
toneStyle: {
type: String,
},
file_ids: { type: [{ type: String }], default: undefined }, file_ids: { type: [{ type: String }], default: undefined },
// deprecated // deprecated
resendImages: { resendImages: {

View file

@ -35,8 +35,6 @@ const addToCache = async ({ endpoint, endpointOption, userMessage, responseMessa
const roles = (options) => { const roles = (options) => {
if (endpoint === 'openAI') { if (endpoint === 'openAI') {
return options?.chatGptLabel || 'ChatGPT'; return options?.chatGptLabel || 'ChatGPT';
} else if (endpoint === 'bingAI') {
return options?.jailbreak ? 'Sydney' : 'BingAI';
} }
}; };

View file

@ -8,7 +8,6 @@ const {
AZURE_API_KEY: azureOpenAIApiKey, AZURE_API_KEY: azureOpenAIApiKey,
ANTHROPIC_API_KEY: anthropicApiKey, ANTHROPIC_API_KEY: anthropicApiKey,
CHATGPT_TOKEN: chatGPTToken, CHATGPT_TOKEN: chatGPTToken,
BINGAI_TOKEN: bingToken,
PLUGINS_USE_AZURE, PLUGINS_USE_AZURE,
GOOGLE_KEY: googleKey, GOOGLE_KEY: googleKey,
OPENAI_REVERSE_PROXY, OPENAI_REVERSE_PROXY,
@ -30,7 +29,6 @@ module.exports = {
useAzurePlugins, useAzurePlugins,
userProvidedOpenAI, userProvidedOpenAI,
googleKey, googleKey,
[EModelEndpoint.bingAI]: generateConfig(bingToken),
[EModelEndpoint.anthropic]: generateConfig(anthropicApiKey), [EModelEndpoint.anthropic]: generateConfig(anthropicApiKey),
[EModelEndpoint.chatGPTBrowser]: generateConfig(chatGPTToken), [EModelEndpoint.chatGPTBrowser]: generateConfig(chatGPTToken),
[EModelEndpoint.openAI]: generateConfig(openAIApiKey, OPENAI_REVERSE_PROXY), [EModelEndpoint.openAI]: generateConfig(openAIApiKey, OPENAI_REVERSE_PROXY),

View file

@ -9,7 +9,7 @@ const { config } = require('./EndpointService');
*/ */
async function loadDefaultEndpointsConfig(req) { async function loadDefaultEndpointsConfig(req) {
const { google, gptPlugins } = await loadAsyncEndpoints(req); const { google, gptPlugins } = await loadAsyncEndpoints(req);
const { assistants, azureAssistants, bingAI, azureOpenAI, chatGPTBrowser } = config; const { assistants, azureAssistants, azureOpenAI, chatGPTBrowser } = config;
const enabledEndpoints = getEnabledEndpoints(); const enabledEndpoints = getEnabledEndpoints();
@ -20,7 +20,6 @@ async function loadDefaultEndpointsConfig(req) {
[EModelEndpoint.azureAssistants]: azureAssistants, [EModelEndpoint.azureAssistants]: azureAssistants,
[EModelEndpoint.azureOpenAI]: azureOpenAI, [EModelEndpoint.azureOpenAI]: azureOpenAI,
[EModelEndpoint.google]: google, [EModelEndpoint.google]: google,
[EModelEndpoint.bingAI]: bingAI,
[EModelEndpoint.chatGPTBrowser]: chatGPTBrowser, [EModelEndpoint.chatGPTBrowser]: chatGPTBrowser,
[EModelEndpoint.gptPlugins]: gptPlugins, [EModelEndpoint.gptPlugins]: gptPlugins,
[EModelEndpoint.anthropic]: config[EModelEndpoint.anthropic], [EModelEndpoint.anthropic]: config[EModelEndpoint.anthropic],

View file

@ -35,7 +35,6 @@ async function loadDefaultModels(req) {
[EModelEndpoint.anthropic]: anthropic, [EModelEndpoint.anthropic]: anthropic,
[EModelEndpoint.gptPlugins]: gptPlugins, [EModelEndpoint.gptPlugins]: gptPlugins,
[EModelEndpoint.azureOpenAI]: azureOpenAI, [EModelEndpoint.azureOpenAI]: azureOpenAI,
[EModelEndpoint.bingAI]: ['BingAI', 'Sydney'],
[EModelEndpoint.chatGPTBrowser]: chatGPTBrowser, [EModelEndpoint.chatGPTBrowser]: chatGPTBrowser,
[EModelEndpoint.assistants]: assistants, [EModelEndpoint.assistants]: assistants,
[EModelEndpoint.azureAssistants]: azureAssistants, [EModelEndpoint.azureAssistants]: azureAssistants,

View file

@ -1,58 +0,0 @@
const citationRegex = /\[\^\d+?\^\]/g;
const regex = / \[.*?]\(.*?\)/g;
/** Helper function to escape special characters in regex
* @param {string} string - The string to escape.
* @returns {string} The escaped string.
*/
function escapeRegExp(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
}
const getCitations = (res) => {
const adaptiveCards = res.details.adaptiveCards;
const textBlocks = adaptiveCards && adaptiveCards[0].body;
if (!textBlocks) {
return '';
}
let links = textBlocks[textBlocks.length - 1]?.text.match(regex);
if (links?.length === 0 || !links) {
return '';
}
links = links.map((link) => link.trim());
return links.join('\n - ');
};
const citeText = (res, noLinks = false) => {
let result = res.text || res;
const citations = Array.from(new Set(result.match(citationRegex)));
if (citations?.length === 0) {
return result;
}
if (noLinks) {
citations.forEach((citation) => {
const digit = citation.match(/\d+?/g)[0];
// result = result.replaceAll(citation, `<sup>[${digit}](#) </sup>`);
result = result.replaceAll(citation, `[^${digit}^](#)`);
});
return result;
}
let sources = res.details.sourceAttributions;
if (sources?.length === 0) {
return result;
}
sources = sources.map((source) => source.seeMoreUrl);
citations.forEach((citation) => {
const digit = citation.match(/\d+?/g)[0];
result = result.replaceAll(citation, `[^${digit}^](${sources[digit - 1]})`);
// result = result.replaceAll(citation, `<sup>[${digit}](${sources[digit - 1]}) </sup>`);
});
return result;
};
module.exports = { getCitations, citeText, escapeRegExp };

View file

@ -10,10 +10,16 @@ const {
defaultAssistantsVersion, defaultAssistantsVersion,
} = require('librechat-data-provider'); } = require('librechat-data-provider');
const { Providers } = require('@librechat/agents'); const { Providers } = require('@librechat/agents');
const { getCitations, citeText } = require('./citations');
const partialRight = require('lodash/partialRight'); const partialRight = require('lodash/partialRight');
const { sendMessage } = require('./streamResponse'); const { sendMessage } = require('./streamResponse');
const citationRegex = /\[\^\d+?\^]/g;
/** Helper function to escape special characters in regex
* @param {string} string - The string to escape.
* @returns {string} The escaped string.
*/
function escapeRegExp(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
}
const addSpaceIfNeeded = (text) => (text.length > 0 && !text.endsWith(' ') ? text + ' ' : text); const addSpaceIfNeeded = (text) => (text.length > 0 && !text.endsWith(' ') ? text + ' ' : text);
@ -64,18 +70,9 @@ const createOnProgress = (
return { onProgress, getPartialText, sendIntermediateMessage }; return { onProgress, getPartialText, sendIntermediateMessage };
}; };
const handleText = async (response, bing = false) => { const handleText = async (response) => {
let { text } = response; let { text } = response;
response.text = text; response.text = text;
if (bing) {
const links = getCitations(response);
if (response.text.match(citationRegex)?.length > 0) {
text = citeText(response);
}
text += links?.length > 0 ? `\n- ${links}` : '';
}
return text; return text;
}; };
@ -262,6 +259,7 @@ module.exports = {
isEnabled, isEnabled,
handleText, handleText,
formatSteps, formatSteps,
escapeRegExp,
formatAction, formatAction,
isUserProvided, isUserProvided,
generateConfig, generateConfig,

View file

@ -2,7 +2,6 @@ const streamResponse = require('./streamResponse');
const removePorts = require('./removePorts'); const removePorts = require('./removePorts');
const countTokens = require('./countTokens'); const countTokens = require('./countTokens');
const handleText = require('./handleText'); const handleText = require('./handleText');
const citations = require('./citations');
const sendEmail = require('./sendEmail'); const sendEmail = require('./sendEmail');
const cryptoUtils = require('./crypto'); const cryptoUtils = require('./crypto');
const queue = require('./queue'); const queue = require('./queue');
@ -27,7 +26,6 @@ module.exports = {
checkEmailConfig, checkEmailConfig,
...cryptoUtils, ...cryptoUtils,
...handleText, ...handleText,
...citations,
countTokens, countTokens,
removePorts, removePorts,
sendEmail, sendEmail,

View file

@ -1321,8 +1321,7 @@
* @property {boolean|{userProvide: boolean}} [azureOpenAI] - Flag to indicate if Azure OpenAI endpoint is user provided, or its configuration. * @property {boolean|{userProvide: boolean}} [azureOpenAI] - Flag to indicate if Azure OpenAI endpoint is user provided, or its configuration.
* @property {boolean|{userProvide: boolean}} [chatGPTBrowser] - Flag to indicate if ChatGPT Browser endpoint is user provided, or its configuration. * @property {boolean|{userProvide: boolean}} [chatGPTBrowser] - Flag to indicate if ChatGPT Browser endpoint is user provided, or its configuration.
* @property {boolean|{userProvide: boolean}} [anthropic] - Flag to indicate if Anthropic endpoint is user provided, or its configuration. * @property {boolean|{userProvide: boolean}} [anthropic] - Flag to indicate if Anthropic endpoint is user provided, or its configuration.
* @property {boolean|{userProvide: boolean}} [bingAI] - Flag to indicate if BingAI endpoint is user provided, or its configuration. * @property {boolean|{userProvide: boolean}} [google] - Flag to indicate if Google endpoint is user provided, or its configuration.
* @property {boolean|{userProvide: boolean}} [google] - Flag to indicate if BingAI endpoint is user provided, or its configuration.
* @property {boolean|{userProvide: boolean, userProvideURL: boolean, name: string}} [custom] - Custom Endpoint configuration. * @property {boolean|{userProvide: boolean, userProvideURL: boolean, name: string}} [custom] - Custom Endpoint configuration.
* @memberof typedefs * @memberof typedefs
*/ */
@ -1353,7 +1352,6 @@
* @property {boolean|{userProvide: boolean}} [azureOpenAI] - Flag to indicate if Azure OpenAI endpoint is user provided, or its configuration. * @property {boolean|{userProvide: boolean}} [azureOpenAI] - Flag to indicate if Azure OpenAI endpoint is user provided, or its configuration.
* @property {boolean|{userProvide: boolean}} [chatGPTBrowser] - Flag to indicate if ChatGPT Browser endpoint is user provided, or its configuration. * @property {boolean|{userProvide: boolean}} [chatGPTBrowser] - Flag to indicate if ChatGPT Browser endpoint is user provided, or its configuration.
* @property {boolean|{userProvide: boolean}} [anthropic] - Flag to indicate if Anthropic endpoint is user provided, or its configuration. * @property {boolean|{userProvide: boolean}} [anthropic] - Flag to indicate if Anthropic endpoint is user provided, or its configuration.
* @property {boolean|{userProvide: boolean}} [bingAI] - Flag to indicate if BingAI endpoint is user provided, or its configuration.
* @property {boolean|{userProvide: boolean}} [google] - Flag to indicate if Google endpoint is user provided, or its configuration. * @property {boolean|{userProvide: boolean}} [google] - Flag to indicate if Google endpoint is user provided, or its configuration.
* @property {boolean|{userProvide: boolean, userProvideURL: boolean, name: string}} [custom] - Custom Endpoint configuration. * @property {boolean|{userProvide: boolean, userProvideURL: boolean, name: string}} [custom] - Custom Endpoint configuration.
* @property {boolean|GptPlugins} [gptPlugins] - Configuration for GPT plugins. * @property {boolean|GptPlugins} [gptPlugins] - Configuration for GPT plugins.

View file

@ -108,5 +108,5 @@ config:
DEBUG_PLUGINS: "true" DEBUG_PLUGINS: "true"
DOMAIN_CLIENT: "" DOMAIN_CLIENT: ""
DOMAIN_SERVER: "" DOMAIN_SERVER: ""
ENDPOINTS: "openAI,azureOpenAI,bingAI,chatGPTBrowser,google,gptPlugins,anthropic" ENDPOINTS: "openAI,azureOpenAI,chatGPTBrowser,google,gptPlugins,anthropic"
SEARCH: false SEARCH: false

View file

@ -27,25 +27,15 @@ export default function HeaderOptions({
); );
const localize = useLocalize(); const localize = useLocalize();
const { showPopover, conversation, latestMessage, setShowPopover, setShowBingToneSetting } = const { showPopover, conversation, setShowPopover } = useChatContext();
useChatContext();
const { setOption } = useSetIndexOptions(); const { setOption } = useSetIndexOptions();
const { endpoint, conversationId, jailbreak = false } = conversation ?? {}; const { endpoint, conversationId } = conversation ?? {};
const altConditions: { [key: string]: boolean } = {
bingAI: !!(latestMessage && jailbreak && endpoint === 'bingAI'),
};
const altSettings: { [key: string]: () => void } = {
bingAI: () => setShowBingToneSetting((prev) => !prev),
};
const noSettings = useMemo<{ [key: string]: boolean }>( const noSettings = useMemo<{ [key: string]: boolean }>(
() => ({ () => ({
[EModelEndpoint.chatGPTBrowser]: true, [EModelEndpoint.chatGPTBrowser]: true,
[EModelEndpoint.bingAI]: jailbreak ? false : conversationId !== 'new',
}), }),
[jailbreak, conversationId], [conversationId],
); );
useEffect(() => { useEffect(() => {
@ -63,9 +53,7 @@ export default function HeaderOptions({
return null; return null;
} }
const triggerAdvancedMode = altConditions[endpoint] const triggerAdvancedMode = () => setShowPopover((prev) => !prev);
? altSettings[endpoint]
: () => setShowPopover((prev) => !prev);
const endpointType = getEndpointField(endpointsConfig, endpoint, 'type'); const endpointType = getEndpointField(endpointsConfig, endpoint, 'type');
const paramEndpoint = isParamEndpoint(endpoint, endpointType); const paramEndpoint = isParamEndpoint(endpoint, endpointType);

View file

@ -6,7 +6,6 @@ import {
GPTIcon, GPTIcon,
AnthropicIcon, AnthropicIcon,
AzureMinimalIcon, AzureMinimalIcon,
BingAIMinimalIcon,
GoogleMinimalIcon, GoogleMinimalIcon,
CustomMinimalIcon, CustomMinimalIcon,
AssistantIcon, AssistantIcon,
@ -68,7 +67,6 @@ export const icons: IconsRecord = {
[EModelEndpoint.anthropic]: AnthropicIcon, [EModelEndpoint.anthropic]: AnthropicIcon,
[EModelEndpoint.chatGPTBrowser]: LightningIcon, [EModelEndpoint.chatGPTBrowser]: LightningIcon,
[EModelEndpoint.google]: GoogleMinimalIcon, [EModelEndpoint.google]: GoogleMinimalIcon,
[EModelEndpoint.bingAI]: BingAIMinimalIcon,
[EModelEndpoint.custom]: CustomMinimalIcon, [EModelEndpoint.custom]: CustomMinimalIcon,
[EModelEndpoint.assistants]: AssistantAvatar, [EModelEndpoint.assistants]: AssistantAvatar,
[EModelEndpoint.azureAssistants]: AssistantAvatar, [EModelEndpoint.azureAssistants]: AssistantAvatar,

View file

@ -63,7 +63,6 @@ const MessageEndpointIcon: React.FC<IconProps> = (props) => {
button, button,
iconURL = '', iconURL = '',
endpoint, endpoint,
jailbreak,
size = 30, size = 30,
model = '', model = '',
assistantName, assistantName,
@ -163,23 +162,6 @@ const MessageEndpointIcon: React.FC<IconProps> = (props) => {
bg: '#268672', bg: '#268672',
name: alternateName[EModelEndpoint.bedrock], name: alternateName[EModelEndpoint.bedrock],
}, },
[EModelEndpoint.bingAI]: {
icon:
jailbreak === true ? (
<img src="/assets/bingai-jb.png" alt="Bing Icon" />
) : (
<img src="/assets/bingai.png" alt="Sydney Icon" />
),
name: jailbreak === true ? 'Sydney' : 'BingAI',
},
[EModelEndpoint.chatGPTBrowser]: {
icon: <GPTIcon size={size * 0.5555555555555556} />,
bg:
typeof model === 'string' && model.toLowerCase().includes('gpt-4')
? '#AB68FF'
: `rgba(0, 163, 255, ${button === true ? 0.75 : 1})`,
name: 'ChatGPT',
},
[EModelEndpoint.custom]: { [EModelEndpoint.custom]: {
icon: <CustomMinimalIcon size={size * 0.7} />, icon: <CustomMinimalIcon size={size * 0.7} />,
name: 'Custom', name: 'Custom',

View file

@ -5,7 +5,6 @@ import {
OpenAIMinimalIcon, OpenAIMinimalIcon,
LightningIcon, LightningIcon,
MinimalPlugin, MinimalPlugin,
BingAIMinimalIcon,
GoogleMinimalIcon, GoogleMinimalIcon,
CustomMinimalIcon, CustomMinimalIcon,
AnthropicIcon, AnthropicIcon,
@ -44,7 +43,6 @@ const MinimalIcon: React.FC<IconProps> = (props) => {
icon: <CustomMinimalIcon />, icon: <CustomMinimalIcon />,
name: 'Custom', name: 'Custom',
}, },
[EModelEndpoint.bingAI]: { icon: <BingAIMinimalIcon />, name: 'BingAI' },
[EModelEndpoint.chatGPTBrowser]: { icon: <LightningIcon />, name: 'ChatGPT' }, [EModelEndpoint.chatGPTBrowser]: { icon: <LightningIcon />, name: 'ChatGPT' },
[EModelEndpoint.assistants]: { icon: <Sparkles className="icon-sm" />, name: 'Assistant' }, [EModelEndpoint.assistants]: { icon: <Sparkles className="icon-sm" />, name: 'Assistant' },
[EModelEndpoint.azureAssistants]: { icon: <Sparkles className="icon-sm" />, name: 'Assistant' }, [EModelEndpoint.azureAssistants]: { icon: <Sparkles className="icon-sm" />, name: 'Assistant' },

View file

@ -1,147 +0,0 @@
import { useEffect, useState } from 'react';
import TextareaAutosize from 'react-textarea-autosize';
import { useUpdateTokenCountMutation } from 'librechat-data-provider/react-query';
import type { TUpdateTokenCountResponse } from 'librechat-data-provider';
import { Label, Checkbox, SelectDropDown } from '~/components/ui';
import { cn, defaultTextProps, removeFocusRings } from '~/utils';
import { useLocalize, useDebounce } from '~/hooks';
import type { TSettingsProps } from '~/common';
export default function Settings({ conversation, setOption, readonly }: TSettingsProps) {
const localize = useLocalize();
const [tokenCount, setTokenCount] = useState(0);
const debouncedContext = useDebounce(conversation?.context?.trim() ?? '', 250);
const updateTokenCountMutation = useUpdateTokenCountMutation();
useEffect(() => {
if (!debouncedContext || debouncedContext === '') {
setTokenCount(0);
return;
}
const handleTextChange = (context: string) => {
updateTokenCountMutation.mutate(
{ text: context },
{
onSuccess: (data: TUpdateTokenCountResponse) => {
setTokenCount(data.count);
},
},
);
};
handleTextChange(debouncedContext);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [debouncedContext]);
if (!conversation) {
return null;
}
const { context, systemMessage, jailbreak, toneStyle } = conversation;
const showSystemMessage = jailbreak;
const setContext = setOption('context');
const setSystemMessage = setOption('systemMessage');
const setJailbreak = setOption('jailbreak');
const setToneStyle = (value: string) => setOption('toneStyle')(value.toLowerCase());
return (
<div className="grid gap-6 sm:grid-cols-2">
<div className="col-span-1 flex flex-col items-center justify-start gap-6">
<div className="grid w-full items-center gap-2">
<Label htmlFor="toneStyle-dropdown" className="text-left text-sm font-medium">
{localize('com_endpoint_tone_style')}{' '}
<small className="opacity-40">({localize('com_endpoint_default_creative')})</small>
</Label>
<SelectDropDown
id="toneStyle-dropdown"
title={''}
value={`${toneStyle?.charAt(0).toUpperCase()}${toneStyle?.slice(1)}`}
setValue={setToneStyle}
availableValues={['Creative', 'Fast', 'Balanced', 'Precise']}
disabled={readonly}
className={cn(defaultTextProps, 'flex w-full resize-none', removeFocusRings)}
containerClassName="flex w-full resize-none"
/>
</div>
<div className="grid w-full items-center gap-2">
<Label htmlFor="context" className="text-left text-sm font-medium">
{localize('com_endpoint_context')}{' '}
<small className="opacity-40">({localize('com_endpoint_default_blank')})</small>
</Label>
<TextareaAutosize
id="context"
disabled={readonly}
value={context || ''}
onChange={(e) => setContext(e.target.value ?? null)}
placeholder={localize('com_endpoint_bing_context_placeholder')}
className={cn(
defaultTextProps,
'flex max-h-[138px] min-h-[100px] w-full resize-none px-3 py-2',
)}
/>
<small className="mb-5 text-black dark:text-white">{`${localize(
'com_endpoint_token_count',
)}: ${tokenCount}`}</small>
</div>
</div>
<div className="col-span-1 flex flex-col items-center justify-start gap-6">
<div className="grid w-full items-center gap-2">
<Label htmlFor="jailbreak" className="text-left text-sm font-medium">
{localize('com_endpoint_bing_enable_sydney')}{' '}
<small className="opacity-40">({localize('com_endpoint_default_false')})</small>
</Label>
<div className="flex h-[40px] w-full items-center space-x-3">
<Checkbox
id="jailbreak"
disabled={readonly}
checked={jailbreak}
className="focus:ring-opacity-20 dark:border-gray-500 dark:bg-gray-700 dark:text-gray-50 dark:focus:ring-gray-600 dark:focus:ring-opacity-50 dark:focus:ring-offset-0"
onCheckedChange={setJailbreak}
/>
<label
htmlFor="jailbreak"
className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 dark:text-gray-50"
>
{localize('com_endpoint_bing_jailbreak')}{' '}
<small>{localize('com_endpoint_bing_to_enable_sydney')}</small>
</label>
</div>
</div>
{showSystemMessage && (
<div className="grid w-full items-center gap-2">
<Label
htmlFor="systemMessage"
className="text-left text-sm font-medium"
style={{ opacity: showSystemMessage ? '1' : '0' }}
>
<a
href="https://github.com/danny-avila/LibreChat/blob/main/docs/features/bing_jailbreak.md#default-system-message-for-jailbreak-mode-sydney"
target="_blank"
className="text-blue-500 transition-colors duration-200 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-500"
rel="noreferrer"
>
{localize('com_endpoint_system_message')}
</a>{' '}
<small className="opacity-40 dark:text-gray-50">
( {localize('com_endpoint_default_blank')})
</small>
</Label>
<TextareaAutosize
id="systemMessage"
disabled={readonly}
value={systemMessage || ''}
onChange={(e) => setSystemMessage(e.target.value ?? null)}
placeholder={localize('com_endpoint_bing_system_message_placeholder')}
className={cn(
defaultTextProps,
'flex max-h-[300px] min-h-[100px] w-full resize-none px-3 py-2 placeholder:text-red-400',
)}
/>
</div>
)}
</div>
</div>
);
}

View file

@ -2,7 +2,6 @@ export { default as Advanced } from './Advanced';
export { default as AssistantsSettings } from './Assistants'; export { default as AssistantsSettings } from './Assistants';
export { default as BedrockSettings } from './Bedrock'; export { default as BedrockSettings } from './Bedrock';
export { default as OpenAISettings } from './OpenAI'; export { default as OpenAISettings } from './OpenAI';
export { default as BingAISettings } from './BingAI';
export { default as GoogleSettings } from './Google'; export { default as GoogleSettings } from './Google';
export { default as PluginsSettings } from './Plugins'; export { default as PluginsSettings } from './Plugins';
export { default as Examples } from './Examples'; export { default as Examples } from './Examples';

View file

@ -5,7 +5,6 @@ import { GoogleSettings, PluginSettings } from './MultiView';
import AssistantsSettings from './Assistants'; import AssistantsSettings from './Assistants';
import AnthropicSettings from './Anthropic'; import AnthropicSettings from './Anthropic';
import BedrockSettings from './Bedrock'; import BedrockSettings from './Bedrock';
import BingAISettings from './BingAI';
import OpenAISettings from './OpenAI'; import OpenAISettings from './OpenAI';
const settings: { [key: string]: FC<TModelSelectProps> | undefined } = { const settings: { [key: string]: FC<TModelSelectProps> | undefined } = {
@ -15,7 +14,6 @@ const settings: { [key: string]: FC<TModelSelectProps> | undefined } = {
[EModelEndpoint.openAI]: OpenAISettings, [EModelEndpoint.openAI]: OpenAISettings,
[EModelEndpoint.custom]: OpenAISettings, [EModelEndpoint.custom]: OpenAISettings,
[EModelEndpoint.azureOpenAI]: OpenAISettings, [EModelEndpoint.azureOpenAI]: OpenAISettings,
[EModelEndpoint.bingAI]: BingAISettings,
[EModelEndpoint.anthropic]: AnthropicSettings, [EModelEndpoint.anthropic]: AnthropicSettings,
[EModelEndpoint.bedrock]: BedrockSettings, [EModelEndpoint.bedrock]: BedrockSettings,
}; };

View file

@ -1,86 +0,0 @@
import { useRecoilValue } from 'recoil';
import { SelectDropDown, SelectDropDownPop, Tabs, TabsList, TabsTrigger } from '~/components/ui';
import { cn, cardStyle } from '~/utils/';
import type { TModelSelectProps } from '~/common';
import store from '~/store';
export default function BingAI({
conversation,
setOption,
models,
showAbove,
popover = false,
}: TModelSelectProps) {
// TODO: index family bing tone settings, important for multiview
const showBingToneSetting = useRecoilValue(store.showBingToneSetting);
if (!conversation) {
return null;
}
const { conversationId, toneStyle, jailbreak } = conversation;
if (conversationId !== 'new' && !showBingToneSetting) {
return null;
}
const defaultClasses =
'p-2 rounded-md min-w-[75px] font-normal bg-white/[.60] dark:bg-gray-700 text-black text-xs';
const defaultSelected = cn(
defaultClasses,
'font-medium data-[state=active]:text-white text-xs text-white',
);
const selectedClass = (val: string) => val + '-tab ' + defaultSelected;
const Menu = popover ? SelectDropDownPop : SelectDropDown;
return (
<>
<Menu
title="Mode"
value={jailbreak ? 'Sydney' : 'BingAI'}
data-testid="bing-select-dropdown"
setValue={(value) => setOption('jailbreak')(value === 'Sydney')}
availableValues={models}
showAbove={showAbove}
showLabel={false}
className={cn(
cardStyle,
'z-50 flex h-[40px] w-36 flex-none items-center justify-center px-4 ring-0 hover:cursor-pointer hover:bg-gray-50 focus:ring-0 focus:ring-offset-0 data-[state=open]:bg-gray-50 dark:bg-gray-800 dark:hover:bg-gray-700 dark:data-[state=open]:bg-gray-600',
showBingToneSetting ? 'hidden' : '',
)}
/>
<Tabs
value={toneStyle ?? 'creative'}
className={cn(
cardStyle,
'z-50 flex h-[40px] flex-none items-center justify-center px-0 hover:bg-gray-50 dark:hover:bg-gray-700',
)}
onValueChange={(value) => setOption('toneStyle')(value.toLowerCase())}
>
<TabsList className="bg-white/[.60] dark:bg-gray-700">
<TabsTrigger
value="creative"
className={`${toneStyle === 'creative' ? selectedClass('creative') : defaultClasses}`}
>
{'Creative'}
</TabsTrigger>
<TabsTrigger
value="fast"
className={`${toneStyle === 'fast' ? selectedClass('fast') : defaultClasses}`}
>
{'Fast'}
</TabsTrigger>
<TabsTrigger
value="balanced"
className={`${toneStyle === 'balanced' ? selectedClass('balanced') : defaultClasses}`}
>
{'Balanced'}
</TabsTrigger>
<TabsTrigger
value="precise"
className={`${toneStyle === 'precise' ? selectedClass('precise') : defaultClasses}`}
>
{'Precise'}
</TabsTrigger>
</TabsList>
</Tabs>
</>
);
}

View file

@ -3,7 +3,6 @@ import type { TModelSelectProps } from '~/common';
import type { FC } from 'react'; import type { FC } from 'react';
import OpenAI from './OpenAI'; import OpenAI from './OpenAI';
import BingAI from './BingAI';
import Google from './Google'; import Google from './Google';
import ChatGPT from './ChatGPT'; import ChatGPT from './ChatGPT';
import Anthropic from './Anthropic'; import Anthropic from './Anthropic';
@ -14,7 +13,6 @@ export const options: { [key: string]: FC<TModelSelectProps> } = {
[EModelEndpoint.custom]: OpenAI, [EModelEndpoint.custom]: OpenAI,
[EModelEndpoint.bedrock]: OpenAI, [EModelEndpoint.bedrock]: OpenAI,
[EModelEndpoint.azureOpenAI]: OpenAI, [EModelEndpoint.azureOpenAI]: OpenAI,
[EModelEndpoint.bingAI]: BingAI,
[EModelEndpoint.google]: Google, [EModelEndpoint.google]: Google,
[EModelEndpoint.anthropic]: Anthropic, [EModelEndpoint.anthropic]: Anthropic,
[EModelEndpoint.chatGPTBrowser]: ChatGPT, [EModelEndpoint.chatGPTBrowser]: ChatGPT,

View file

@ -5,30 +5,6 @@ import { useLocalize } from '~/hooks';
function HelpText({ endpoint }: { endpoint: string }) { function HelpText({ endpoint }: { endpoint: string }) {
const localize = useLocalize(); const localize = useLocalize();
const textMap = { const textMap = {
[EModelEndpoint.bingAI]: (
<small className="break-all text-gray-500">
{localize('com_endpoint_config_key_get_edge_key')}{' '}
<a
target="_blank"
href="https://www.bing.com"
rel="noreferrer"
className="text-blue-600 underline"
>
https://www.bing.com
</a>
{'. '}
{localize('com_endpoint_config_key_get_edge_key_dev_tool')}{' '}
<a
target="_blank"
href="https://github.com/waylaidwanderer/node-chatgpt-api/issues/378#issuecomment-1559868368"
rel="noreferrer"
className="text-blue-600 underline"
>
{localize('com_endpoint_config_key_edge_instructions')}
</a>{' '}
{localize('com_endpoint_config_key_edge_full_token_string')}
</small>
),
[EModelEndpoint.chatGPTBrowser]: ( [EModelEndpoint.chatGPTBrowser]: (
<small className="break-all text-gray-500"> <small className="break-all text-gray-500">
{localize('com_endpoint_config_key_chatgpt')}{' '} {localize('com_endpoint_config_key_chatgpt')}{' '}

View file

@ -31,7 +31,7 @@ const SearchBar = forwardRef((props: SearchBarProps, ref: Ref<HTMLDivElement>) =
const clearSearch = useCallback(() => { const clearSearch = useCallback(() => {
setPageNumber(1); setPageNumber(1);
if (location.pathname.includes('/search')) { if (location.pathname.includes('/search')) {
newConversation(); newConversation({ disableFocus: true });
} }
}, [newConversation, setPageNumber, location.pathname]); }, [newConversation, setPageNumber, location.pathname]);

View file

@ -61,8 +61,7 @@ export default function AgentPanel({
!isAssistantsEndpoint(key) && !isAssistantsEndpoint(key) &&
key !== EModelEndpoint.agents && key !== EModelEndpoint.agents &&
key !== EModelEndpoint.chatGPTBrowser && key !== EModelEndpoint.chatGPTBrowser &&
key !== EModelEndpoint.gptPlugins && key !== EModelEndpoint.gptPlugins,
key !== EModelEndpoint.bingAI,
) )
.map((provider) => createProviderOption(provider)), .map((provider) => createProviderOption(provider)),
[endpointsConfig], [endpointsConfig],

View file

@ -1,21 +0,0 @@
import { cn } from '~/utils';
export default function BingAIMinimalIcon({ className = '' }) {
return (
<svg
stroke="currentColor"
fill="none"
strokeWidth="1"
viewBox="0 0 24 24"
strokeLinecap="round"
strokeLinejoin="round"
className={cn('h-4 w-4', className)}
height="1em"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<path d="m12.648 7.5685c-0.50544 0.051397-0.89091 0.41065-0.92674 0.8637-0.01545 0.19521-0.0106 0.20845 0.49497 1.3471 1.1502 2.5905 1.4289 3.214 1.4758 3.3018 0.11355 0.21251 0.27321 0.41243 0.47269 0.59187 0.15307 0.1377 0.25403 0.21173 0.42478 0.31156 0.3001 0.17541 0.44902 0.2239 1.6168 0.5265 1.1375 0.29477 1.759 0.49069 2.2945 0.7233 0.69376 0.30136 1.1778 0.64416 1.484 1.0509 0.21968 0.29184 0.41423 0.81518 0.49888 1.342 0.0331 0.20592 0.03332 0.66112 4.01e-4 0.84729-0.07142 0.40404-0.21408 0.74262-0.43231 1.026-0.11606 0.15068-0.07568 0.12546 0.09306-0.05817 0.47754-0.51963 0.96399-1.4077 1.2122-2.2131 0.30039-0.9747 0.34126-2.0213 0.11759-3.012-0.43558-1.9291-1.8271-3.594-3.7869-4.5307-0.12313-0.058878-0.59216-0.27403-1.228-0.56337-0.096488-0.043922-0.22806-0.10404-0.29238-0.13359-0.064327-0.029581-0.1959-0.089695-0.29238-0.13359-0.096489-0.043895-0.37425-0.17055-0.61725-0.28144-0.243-0.11091-0.5149-0.23498-0.60423-0.27574-0.27232-0.12427-0.45504-0.20775-0.59127-0.27016-0.63008-0.28868-0.89678-0.40538-0.9728-0.42563-0.07975-0.021233-0.28234-0.048493-0.33317-0.044835-0.01071 7.938e-4 -0.05937 0.00549-0.10814 0.010432z" />
<path d="m14.021 17.239c-0.03492 0.01809-0.08393 0.0443-0.10894 0.0582-0.02504 0.01392-0.08058 0.04413-0.12346 0.06717-0.15738 0.08454-0.57595 0.31026-0.93564 0.50458-0.23638 0.12771-0.27147 0.14674-0.57175 0.30984-0.10723 0.05822-0.22126 0.11958-0.25342 0.13636-0.03216 0.01678-0.16957 0.09084-0.30537 0.16458-0.1358 0.07371-0.37261 0.20168-0.52628 0.28434-0.15366 0.08264-0.4285 0.23102-0.61074 0.32972-0.18226 0.09867-0.42202 0.22807-0.53278 0.28753-0.11079 0.05944-0.21311 0.11686-0.22741 0.12759-0.021237 0.01594-1.0065 0.5501-1.5009 0.8137-0.37548 0.20018-0.80985 0.33408-1.2545 0.38667-0.20701 0.02447-0.59874 0.02456-0.80516 1.4e-4 -0.55972-0.066143-1.0754-0.24884-1.517-0.5374-0.17322-0.1132-0.49933-0.39839-0.62401-0.54572-0.2938-0.34713-0.48386-0.71948-0.58229-1.1408-0.02265-0.09696-0.044078-0.17883-0.047599-0.18197-0.0092-0.0081 0.00742 0.13833 0.037398 0.32981 0.031175 0.19915 0.097605 0.4872 0.16915 0.73355 0.55368 1.9065 2.1292 3.4572 4.2621 4.195 0.61417 0.21234 1.2339 0.34617 1.9083 0.4118 0.25339 0.02484 0.97064 0.03469 1.2351 0.01711 1.2128-0.08039 2.2688-0.39281 3.3521-0.99199 0.09649-0.05337 0.27776-0.1534 0.40282-0.22233 0.12509-0.06891 0.28296-0.15652 0.35087-0.19465 0.06789-0.03815 0.14975-0.08323 0.18192-0.10015 0.03216-0.01695 0.09649-0.05231 0.14295-0.07863 0.04646-0.02629 0.24528-0.13636 0.44181-0.24457l1.0558-0.58364 0.0097-0.0054 0.02973-0.01643 0.01414-0.0078 0.88532-0.4894c0.8749-0.48115 1.1358-0.65006 1.5423-0.99853 0.16946-0.14524 0.42494-0.39321 0.43764-0.42469 0.0026-0.0064 0.04799-0.06771 0.10091-0.13624 0.2151-0.27856 0.35853-0.61978 0.42966-1.0222 0.03291-0.18616 0.0327-0.64137-4.02e-4 -0.84729-0.06398-0.39813-0.20934-0.84973-0.36605-1.1373-0.25701-0.47152-0.80449-0.89995-1.591-1.245-0.21716-0.09527-0.44141-0.18246-0.46645-0.18131-0.01187 5.39e-4 -0.74376 0.39206-1.6264 0.87009-0.88266 0.47803-1.6487 0.89294-1.7023 0.92205-0.05362 0.02913-0.14571 0.07838-0.20468 0.10941z" />
<path d="m3.481 14.946 0.00378 3.3294 0.049238 0.19334c0.15396 0.60448 0.42072 1.0403 0.88446 1.4451 0.21813 0.19041 0.38493 0.3052 0.62131 0.42762 0.50018 0.25906 1.0385 0.38686 1.6281 0.38663 0.61757-2.82e-4 1.1518-0.1351 1.7023-0.42959 0.092899-0.04969 0.45692-0.24584 0.80891-0.43589l0.63999-0.34554v-7.9005l-1.874e-4 -3.6137c-1.339e-4 -2.3055-0.0049543-3.6747-0.013283-3.7821-0.052488-0.67502-0.37505-1.2956-0.91745-1.765-0.16646-0.14405-0.30869-0.24027-0.7324-0.49545-0.21084-0.12699-0.59679-0.35962-0.85765-0.51695-0.26086-0.15734-0.69065-0.41654-0.9551-0.57601-0.26445-0.15946-0.64162-0.38697-0.83816-0.50557-0.40945-0.24708-0.4415-0.26426-0.56527-0.30302-0.16099-0.050404-0.3316-0.068919-0.4938-0.053589-0.47275 0.044684-0.85119 0.34342-0.94956 0.74955-0.015308 0.063187-0.018128 0.90411-0.018323 5.4682l-2.205e-4 5.3936h-5.06e-4z" />
</svg>
);
}

View file

@ -1,12 +0,0 @@
import React from 'react';
export default function BingChatIcon() {
return (
<svg xmlns="http://www.w3.org/2000/svg" width="41" height="41" fill="none">
<path
fill="#174AE4"
d="M8 0a8 8 0 1 1-3.613 15.14l-.121-.065-3.645.91a.5.5 0 0 1-.62-.441v-.082l.014-.083.91-3.644-.063-.12a7.95 7.95 0 0 1-.83-2.887l-.025-.382L0 8a8 8 0 0 1 8-8Zm.5 9h-3l-.09.008a.5.5 0 0 0 0 .984L5.5 10h3l.09-.008a.5.5 0 0 0 0-.984L8.5 9Zm2-3h-5l-.09.008a.5.5 0 0 0 0 .984L5.5 7h5l.09-.008a.5.5 0 0 0 0-.984L10.5 6Z"
/>
</svg>
);
}

View file

@ -1,282 +0,0 @@
import React from 'react';
export default function BingIcon() {
return (
<svg width={32} height={32} viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="a" x1={22} x2={22} y1={2} y2={38} gradientUnits="userSpaceOnUse">
<stop stopColor="#F9F9F9" />
<stop
offset={1}
stopColor="#EDF0F9"
style={{
stopColor: '#000',
stopOpacity: 1,
}}
/>
</linearGradient>
<linearGradient
id="b"
x1={4.137}
x2={44.564}
y1={44.75}
y2={38.792}
gradientUnits="userSpaceOnUse"
>
<stop offset={0.108} stopColor="#1D6CF2" />
<stop offset={0.871} stopColor="#1B4AEF" />
</linearGradient>
<linearGradient
id="g"
x1={21.172}
x2={30.46}
y1={18.646}
y2={23.99}
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#37BDFF" />
<stop offset={0.183} stopColor="#33BFFD" />
<stop offset={0.358} stopColor="#28C5F5" />
<stop offset={0.528} stopColor="#15D0E9" />
<stop offset={0.547} stopColor="#12D1E7" />
<stop offset={0.59} stopColor="#1CD2E5" />
<stop offset={0.768} stopColor="#42D8DC" />
<stop offset={0.911} stopColor="#59DBD6" />
<stop offset={1} stopColor="#62DCD4" />
</linearGradient>
<linearGradient
id="h"
x1={15.739}
x2={29.233}
y1={26.703}
y2={26.703}
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#39D2FF" />
<stop offset={0.15} stopColor="#38CEFE" />
<stop offset={0.293} stopColor="#35C3FA" />
<stop offset={0.433} stopColor="#2FB0F3" />
<stop offset={0.547} stopColor="#299AEB" />
<stop offset={0.583} stopColor="#2692EC" />
<stop offset={0.763} stopColor="#1A6CF1" />
<stop offset={0.909} stopColor="#1355F4" />
<stop offset={1} stopColor="#104CF5" />
</linearGradient>
<linearGradient
id="i"
x1={18.23}
x2={18.23}
y1={27.894}
y2={9.79}
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#1B48EF" />
<stop offset={0.122} stopColor="#1C51F0" />
<stop offset={0.321} stopColor="#1E69F5" />
<stop offset={0.568} stopColor="#2190FB" />
<stop offset={1} stopColor="#26B8F4" />
</linearGradient>
<linearGradient
id="j"
x1={18.421}
x2={26.776}
y1={30.045}
y2={21.718}
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#fff" />
<stop offset={0.373} stopColor="#FDFDFD" />
<stop offset={0.507} stopColor="#F6F6F6" />
<stop offset={0.603} stopColor="#EBEBEB" />
<stop offset={0.68} stopColor="#DADADA" />
<stop offset={0.746} stopColor="#C4C4C4" />
<stop offset={0.805} stopColor="#A8A8A8" />
<stop offset={0.858} stopColor="#888" />
<stop offset={0.907} stopColor="#626262" />
<stop offset={0.952} stopColor="#373737" />
<stop offset={0.993} stopColor="#090909" />
<stop offset={1} />
</linearGradient>
<linearGradient
id="k"
x1={18.23}
x2={18.23}
y1={9.469}
y2={27.707}
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#fff" />
<stop offset={0.373} stopColor="#FDFDFD" />
<stop offset={0.507} stopColor="#F6F6F6" />
<stop offset={0.603} stopColor="#EBEBEB" />
<stop offset={0.68} stopColor="#DADADA" />
<stop offset={0.746} stopColor="#C4C4C4" />
<stop offset={0.805} stopColor="#A8A8A8" />
<stop offset={0.858} stopColor="#888" />
<stop offset={0.907} stopColor="#626262" />
<stop offset={0.952} stopColor="#373737" />
<stop offset={0.993} stopColor="#090909" />
<stop offset={1} />
</linearGradient>
<radialGradient
id="c"
cx={0}
cy={0}
r={1}
gradientTransform="rotate(14.036 -132.013 71.177) scale(31.8068)"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#0B31A3" />
<stop offset={1} stopColor="#39A0ED" />
</radialGradient>
<radialGradient
id="d"
cx={0}
cy={0}
r={1}
gradientTransform="rotate(-140.774 10.754 4.54) scale(20.3315)"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#00FFF3" stopOpacity={0.77} />
<stop offset={0.423} stopColor="#00FFF3" stopOpacity={0.72} />
<stop offset={1} stopColor="#5BDCD6" stopOpacity={0} />
</radialGradient>
<clipPath id="e">
<path fill="#fff" d="M11.2 9.2h21.6v21.6H11.2Z" />
</clipPath>
<filter
id="f"
width={21.6}
height={24.3}
x={11.2}
y={9.2}
colorInterpolationFilters="sRGB"
filterUnits="userSpaceOnUse"
>
<feFlood floodOpacity={0} result="BackgroundImageFix" />
<feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape" />
<feColorMatrix
in="SourceAlpha"
result="hardAlpha"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
/>
<feOffset dy={2.7} />
<feGaussianBlur stdDeviation={4.388} />
<feComposite in2="hardAlpha" k2={-1} k3={1} operator="arithmetic" />
<feColorMatrix values="0 0 0 0 0.81875 0 0 0 0 0.824081 0 0 0 0 1 0 0 0 0.37 0" />
<feBlend in2="shape" result="effect1_innerShadow_1360_20280" />
</filter>
</defs>
<path
fill="url(#a)"
d="M16 .005C24.836.005 32 7.166 32 16s-7.164 15.996-16 15.996c-1.779 0-3.516-.292-5.158-.85-1.509-.513-3.127-.754-4.669-.353l-4.468 1.163a1.36 1.36 0 0 1-1.66-1.659l1.162-4.46c.402-1.543.16-3.163-.355-4.673A15.982 15.98 0 0 1 0 16C0 7.166 7.164.005 16 .005Z"
style={{
display: 'inline',
fill: '#000',
fillOpacity: 0.849858,
strokeWidth: 0.888825,
}}
/>
<path
fill="url(#a)"
d="M16.073.44c8.554 0 15.488 6.943 15.488 15.509s-6.934 15.51-15.488 15.51a15.47 15.47 0 0 1-4.993-.824c-1.46-.498-3.027-.731-4.519-.342l-4.325 1.128a1.316 1.319 0 0 1-1.607-1.609l1.125-4.324c.389-1.497.155-3.068-.344-4.532a15.47 15.495 0 0 1-.825-5.007C.585 7.383 7.52.439 16.073.439z"
style={{
display: 'inline',
fill: '#fff',
fillOpacity: 1,
strokeWidth: 0.861109,
}}
/>
<g
style={{
display: 'inline',
}}
strokeWidth={1.5}
>
<path
stroke="url(#b)"
d="M5.729 37.224a.78.78 0 0 1-.951-.951l1.306-5.018c.503-1.932.19-3.915-.415-5.69a17.23 17.23 0 0 1-.919-5.568C4.75 10.472 12.473 2.75 22 2.75c9.527 0 17.25 7.722 17.25 17.247 0 9.526-7.723 17.248-17.25 17.248-1.919 0-3.792-.314-5.561-.916-1.774-.604-3.754-.915-5.683-.413z"
style={{
display: 'inline',
fill: 'none',
stroke: 'url(#b)',
}}
transform="matrix(.88887 0 0 .88875 -3.556 -1.773)"
/>
<path
stroke="url(#c)"
strokeOpacity={0.6}
d="M5.729 37.224a.78.78 0 0 1-.951-.951l1.306-5.018c.503-1.932.19-3.915-.415-5.69a17.23 17.23 0 0 1-.919-5.568C4.75 10.472 12.473 2.75 22 2.75c9.527 0 17.25 7.722 17.25 17.247 0 9.526-7.723 17.248-17.25 17.248-1.919 0-3.792-.314-5.561-.916-1.774-.604-3.754-.915-5.683-.413z"
style={{
display: 'inline',
fill: 'none',
stroke: 'url(#c)',
}}
transform="matrix(.88887 0 0 .88875 -3.556 -1.773)"
/>
<path
stroke="url(#d)"
strokeOpacity={0.8}
d="M5.729 37.224a.78.78 0 0 1-.951-.951l1.306-5.018c.503-1.932.19-3.915-.415-5.69a17.23 17.23 0 0 1-.919-5.568C4.75 10.472 12.473 2.75 22 2.75c9.527 0 17.25 7.722 17.25 17.247 0 9.526-7.723 17.248-17.25 17.248-1.919 0-3.792-.314-5.561-.916-1.774-.604-3.754-.915-5.683-.413z"
style={{
display: 'inline',
fill: 'none',
stroke: 'url(#d)',
}}
transform="matrix(.88887 0 0 .88875 -3.556 -1.773)"
/>
</g>
<g
clipPath="url(#e)"
filter="url(#f)"
transform="matrix(.88889 0 0 .88876 -3.555 -1.773)"
style={{
fill: 'none',
}}
>
<path
fill="url(#g)"
d="M30.1 23.08a5.706 5.706 0 0 1-1.529 3.9 2.582 2.582 0 0 0 .562-1.009c.01-.037.02-.074.028-.112a.244.244 0 0 0 .004-.013c.01-.037.016-.074.023-.111.007-.039.015-.078.02-.116v-.003a2.48 2.48 0 0 0 .026-.364 2.563 2.563 0 0 0-.786-1.856 2.55 2.55 0 0 0-1.143-.643l-.006-.001-.046-.016-.665-.23-1.74-.6c-.006-.002-.013-.002-.017-.004l-.109-.04a1.616 1.616 0 0 1-.82-.723l-.636-1.626-.727-1.862-.14-.359-.036-.073a.826.826 0 0 1-.061-.314c0-.028 0-.057.003-.083a.814.814 0 0 1 1.123-.666l3.242 1.668.64.328c.338.202.654.44.942.708a5.715 5.715 0 0 1 1.847 4.22z"
style={{
display: 'inline',
fill: 'url(#g)',
}}
/>
<path
fill="url(#h)"
d="M29.233 25.252c0 .166-.016.326-.045.483a2.747 2.747 0 0 1-.13.452c-.014.037-.03.073-.045.11a2.61 2.61 0 0 1-.443.683c-.472.525-2.076 1.46-2.668 1.84l-1.313.805c-.961.594-1.87 1.015-3.017 1.044l-.16.003a5.71 5.71 0 0 1-4.83-2.67 5.666 5.666 0 0 1-.843-2.387 2.53 2.53 0 0 0 3.703 1.783l.129-.078.522-.31.666-.394v-.019l.085-.051 5.952-3.538.458-.272.045.015.006.002a2.55 2.55 0 0 1 1.389.917 2.577 2.577 0 0 1 .54 1.582z"
style={{
display: 'inline',
fill: 'url(#h)',
}}
/>
<path
fill="url(#i)"
d="m20.76 13.446-.002 13.17-.665.395-.523.309-.129.078-.008.004a2.528 2.528 0 0 1-3.734-2.263V10.318a.849.849 0 0 1 1.32-.705l2.59 1.697c.013.012.029.022.045.032a2.543 2.543 0 0 1 1.106 2.104z"
style={{
display: 'inline',
fill: 'url(#i)',
}}
/>
<path
fill="url(#j)"
d="M29.233 25.252c0 .166-.016.326-.045.483a2.747 2.747 0 0 1-.13.452c-.014.037-.03.073-.045.11a2.587 2.587 0 0 1-.443.683c-.472.525-2.076 1.46-2.668 1.84l-1.313.805c-.961.594-1.87 1.015-3.017 1.044l-.16.003a5.71 5.71 0 0 1-4.83-2.67 5.666 5.666 0 0 1-.843-2.387 2.53 2.53 0 0 0 3.703 1.783l.129-.078.522-.31.666-.394v-.019l.085-.051 5.952-3.538.458-.272.045.015.006.002a2.55 2.55 0 0 1 1.389.917 2.577 2.577 0 0 1 .54 1.582z"
opacity={0.15}
style={{
display: 'inline',
fill: 'url(#j)',
}}
/>
<path
fill="url(#k)"
d="m20.76 13.446-.002 13.17-.665.395-.523.309-.129.078-.008.004a2.528 2.528 0 0 1-3.734-2.263V10.318a.849.849 0 0 1 1.32-.705l2.59 1.697c.013.012.029.022.045.032a2.543 2.543 0 0 1 1.106 2.104z"
opacity={0.1}
style={{
display: 'inline',
fill: 'url(#k)',
}}
/>
</g>
</svg>
);
}

View file

@ -1,135 +0,0 @@
import React from 'react';
export default function BingIcon({ size = 25 }) {
return (
<svg
width={size}
height={size}
viewBox="0 0 56 56"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g clipPath="url(#clip0_36_2239)">
<path
d="M46.9982 35.9868C46.9982 36.5323 46.9689 37.0747 46.9103 37.6092C46.5619 40.8696 45.1683 43.8178 43.0701 46.098C43.3344 45.8007 43.5726 45.4815 43.7815 45.1397C43.9426 44.8799 44.086 44.6091 44.207 44.3266C44.251 44.2337 44.291 44.137 44.3242 44.041C44.3643 43.9481 44.3974 43.8514 44.4267 43.7554C44.4599 43.6664 44.4892 43.5736 44.5146 43.4807C44.54 43.3839 44.5662 43.2879 44.5878 43.1912C44.5917 43.1803 44.5955 43.1685 44.5986 43.1576C44.621 43.0609 44.6387 42.9649 44.6572 42.8681C44.6757 42.7682 44.6942 42.6675 44.7088 42.5677C44.7088 42.5638 44.7088 42.5638 44.7088 42.5606C44.7235 42.4678 44.7343 42.3749 44.742 42.2781C44.7643 42.0589 44.7751 41.8404 44.7751 41.6172C44.7751 40.3624 44.4336 39.1848 43.8363 38.1828C43.7006 37.9487 43.5503 37.7263 43.3853 37.5148C43.1911 37.262 42.9822 37.0247 42.7548 36.8054C42.1898 36.2522 41.5299 35.7988 40.8 35.4796C40.4847 35.3384 40.1548 35.2236 39.8172 35.1378C39.8133 35.1378 39.8064 35.1339 39.8025 35.1339L39.6853 35.0933L37.9764 34.4995V34.4956L33.5056 32.9395C33.491 32.9356 33.4725 32.9356 33.4617 32.9325L33.1826 32.8287C32.2838 32.4721 31.5392 31.8041 31.0736 30.9535L29.4418 26.7387L27.571 21.9114L27.2118 20.9796L27.1201 20.79C27.0175 20.5372 26.962 20.2625 26.962 19.9769C26.962 19.9027 26.962 19.8286 26.9697 19.7615C27.0761 18.6994 27.9672 17.8676 29.0456 17.8676C29.3316 17.8676 29.6068 17.9269 29.8565 18.0346L38.1876 22.3593L39.831 23.2099C40.7005 23.7336 41.5107 24.35 42.2514 25.0446C44.9362 27.5402 46.6968 31.0378 46.9612 34.9482C46.9836 35.2931 46.9982 35.638 46.9982 35.9868Z"
fill="url(#paint0_linear_36_2239)"
/>
<path
d="M44.7717 41.6165C44.7717 42.0472 44.7316 42.4631 44.6576 42.8682C44.6353 42.9758 44.6137 43.0835 44.5883 43.1912C44.5405 43.384 44.4896 43.5697 44.4272 43.7554C44.394 43.8522 44.3609 43.9482 44.3246 44.041C44.2876 44.1378 44.2475 44.2307 44.2075 44.3267C44.0864 44.6092 43.9431 44.8799 43.782 45.1398C43.5731 45.4816 43.3341 45.8008 43.0705 46.0981C41.8564 47.4575 37.7333 49.8813 36.214 50.8661L32.8408 52.9528C30.3695 54.4948 28.0324 55.5858 25.087 55.6599C24.9475 55.6638 24.8119 55.6677 24.6762 55.6677C24.4858 55.6677 24.2985 55.6638 24.1112 55.6568C19.1231 55.464 14.7726 52.753 12.2643 48.7466C11.1165 46.9159 10.3573 44.8144 10.1006 42.5568C10.6394 45.6424 13.2957 47.9819 16.4977 47.9819C17.62 47.9819 18.673 47.6963 19.5933 47.1906C19.6003 47.1867 19.608 47.1828 19.6157 47.1797L19.9456 46.9791L21.2884 46.1769L22.9973 45.1523V45.1039L23.2178 44.9705L38.5095 35.7988L39.6866 35.0934L39.8037 35.134C39.8076 35.134 39.8145 35.1379 39.8184 35.1379C40.156 35.2229 40.4859 35.3384 40.8012 35.4797C41.5311 35.7988 42.191 36.2522 42.756 36.8055C42.9834 37.0248 43.1923 37.262 43.3865 37.5149C43.5515 37.7263 43.7018 37.9495 43.8375 38.1828C44.4302 39.1841 44.7717 40.3616 44.7717 41.6165Z"
fill="url(#paint1_linear_36_2239)"
/>
<path
d="M23.0013 11.0082L22.9959 45.1507L21.287 46.1761L19.9434 46.9775L19.6127 47.1804C19.6073 47.1804 19.5973 47.1859 19.5927 47.1906C18.6708 47.6931 17.6178 47.9826 16.4947 47.9826C13.2919 47.9826 10.6403 45.6431 10.0984 42.5575C10.0729 42.4155 10.0537 42.268 10.0383 42.126C10.0182 41.8568 10.0036 41.593 9.99817 41.3238V2.8986C9.99817 1.68591 10.971 0.696411 12.1734 0.696411C12.6244 0.696411 13.0453 0.838438 13.3914 1.07177L20.0428 5.47146C20.0783 5.5019 20.1176 5.52765 20.1585 5.55262C21.8782 6.74034 23.0013 8.73963 23.0013 11.0082Z"
fill="url(#paint2_linear_36_2239)"
/>
<path
opacity="0.15"
d="M44.7717 41.6165C44.7717 42.0472 44.7316 42.4631 44.6576 42.8682C44.6353 42.9758 44.6137 43.0835 44.5883 43.1912C44.5405 43.384 44.4896 43.5697 44.4272 43.7554C44.394 43.8522 44.3609 43.9482 44.3246 44.041C44.2876 44.1378 44.2475 44.2307 44.2075 44.3267C44.0864 44.6092 43.9431 44.8799 43.782 45.1398C43.5731 45.4816 43.3349 45.8008 43.0705 46.0981C41.8564 47.4575 37.7333 49.8813 36.214 50.8661L32.8408 52.9528C30.3695 54.4948 28.0324 55.5858 25.087 55.6599C24.9475 55.6638 24.8119 55.6677 24.6762 55.6677C24.4858 55.6677 24.2985 55.6638 24.1112 55.6568C19.1231 55.464 14.7726 52.753 12.2643 48.7466C11.1165 46.9159 10.3573 44.8144 10.1006 42.5568C10.6394 45.6424 13.2957 47.9819 16.4977 47.9819C17.62 47.9819 18.673 47.6963 19.5933 47.1906C19.6003 47.1867 19.608 47.1828 19.6157 47.1797L19.9456 46.9791L21.2884 46.1769L22.9973 45.1523V45.1039L23.2178 44.9705L38.5095 35.7988L39.6866 35.0934L39.8037 35.134C39.8076 35.134 39.8145 35.1379 39.8184 35.1379C40.156 35.2229 40.4859 35.3384 40.8012 35.4797C41.5311 35.7988 42.191 36.2522 42.756 36.8055C42.9834 37.0248 43.1923 37.262 43.3865 37.5149C43.5515 37.7263 43.7018 37.9495 43.8375 38.1828C44.4302 39.1841 44.7717 40.3616 44.7717 41.6165Z"
fill="url(#paint3_linear_36_2239)"
/>
<path
opacity="0.1"
d="M23.0013 11.0082L22.9959 45.1507L21.287 46.1761L19.9434 46.9775L19.6127 47.1804C19.6073 47.1804 19.5973 47.1859 19.5927 47.1906C18.6708 47.6931 17.6178 47.9826 16.4947 47.9826C13.2919 47.9826 10.6403 45.6431 10.0984 42.5575C10.0729 42.4155 10.0537 42.268 10.0383 42.126C10.0182 41.8568 10.0036 41.593 9.99817 41.3238V2.8986C9.99817 1.68591 10.971 0.696411 12.1734 0.696411C12.6244 0.696411 13.0453 0.838438 13.3914 1.07177L20.0428 5.47146C20.0783 5.5019 20.1176 5.52765 20.1585 5.55262C21.8782 6.74034 23.0013 8.73963 23.0013 11.0082Z"
fill="url(#paint4_linear_36_2239)"
/>
</g>
<defs>
<linearGradient
id="paint0_linear_36_2239"
x1="24.061"
y1="24.49"
x2="48.0304"
y2="38.1597"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#37BDFF" />
<stop offset="0.1832" stopColor="#33BFFD" />
<stop offset="0.3576" stopColor="#28C5F5" />
<stop offset="0.528" stopColor="#15D0E9" />
<stop offset="0.5468" stopColor="#12D1E7" />
<stop offset="0.5903" stopColor="#1CD2E5" />
<stop offset="0.7679" stopColor="#42D8DC" />
<stop offset="0.9107" stopColor="#59DBD6" />
<stop offset="1" stopColor="#62DCD4" />
</linearGradient>
<linearGradient
id="paint1_linear_36_2239"
x1="10.099"
y1="45.3798"
x2="44.7715"
y2="45.3798"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#39D2FF" />
<stop offset="0.1501" stopColor="#38CEFE" />
<stop offset="0.2931" stopColor="#35C3FA" />
<stop offset="0.4327" stopColor="#2FB0F3" />
<stop offset="0.5468" stopColor="#299AEB" />
<stop offset="0.5827" stopColor="#2692EC" />
<stop offset="0.7635" stopColor="#1A6CF1" />
<stop offset="0.909" stopColor="#1355F4" />
<stop offset="1" stopColor="#104CF5" />
</linearGradient>
<linearGradient
id="paint2_linear_36_2239"
x1="16.4996"
y1="48.4653"
x2="16.4996"
y2="1.52914"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#1B48EF" />
<stop offset="0.1221" stopColor="#1C51F0" />
<stop offset="0.3212" stopColor="#1E69F5" />
<stop offset="0.5676" stopColor="#2190FB" />
<stop offset="1" stopColor="#26B8F4" />
</linearGradient>
<linearGradient
id="paint3_linear_36_2239"
x1="16.9908"
y1="54.0427"
x2="38.6508"
y2="32.6475"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="white" />
<stop offset="0.3726" stopColor="#FDFDFD" />
<stop offset="0.5069" stopColor="#F6F6F6" />
<stop offset="0.6026" stopColor="#EBEBEB" />
<stop offset="0.68" stopColor="#DADADA" />
<stop offset="0.7463" stopColor="#C4C4C4" />
<stop offset="0.805" stopColor="#A8A8A8" />
<stop offset="0.8581" stopColor="#888888" />
<stop offset="0.9069" stopColor="#626262" />
<stop offset="0.9523" stopColor="#373737" />
<stop offset="0.9926" stopColor="#090909" />
<stop offset="1" />
</linearGradient>
<linearGradient
id="paint4_linear_36_2239"
x1="16.4996"
y1="0.696411"
x2="16.4996"
y2="47.9822"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="white" />
<stop offset="0.3726" stopColor="#FDFDFD" />
<stop offset="0.5069" stopColor="#F6F6F6" />
<stop offset="0.6026" stopColor="#EBEBEB" />
<stop offset="0.68" stopColor="#DADADA" />
<stop offset="0.7463" stopColor="#C4C4C4" />
<stop offset="0.805" stopColor="#A8A8A8" />
<stop offset="0.8581" stopColor="#888888" />
<stop offset="0.9069" stopColor="#626262" />
<stop offset="0.9523" stopColor="#373737" />
<stop offset="0.9926" stopColor="#090909" />
<stop offset="1" />
</linearGradient>
<clipPath id="clip0_36_2239">
<rect width="37" height="56" fill="white" transform="translate(10)"></rect>
</clipPath>
</defs>
</svg>
);
}

View file

@ -1,267 +0,0 @@
import React from 'react';
export default function BingIcon() {
return (
<svg width={32} height={32} viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="a" x1={22} x2={22} y1={2} y2={38} gradientUnits="userSpaceOnUse">
<stop stopColor="#F9F9F9" />
<stop
offset={1}
stopColor="#EDF0F9"
style={{
stopColor: '#000',
stopOpacity: 1,
}}
/>
</linearGradient>
<linearGradient
id="b"
x1={4.137}
x2={44.564}
y1={44.75}
y2={38.792}
gradientUnits="userSpaceOnUse"
>
<stop offset={0.108} stopColor="#1D6CF2" />
<stop offset={0.871} stopColor="#1B4AEF" />
</linearGradient>
<linearGradient
id="g"
x1={21.172}
x2={30.46}
y1={18.646}
y2={23.99}
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#37BDFF" />
<stop offset={0.183} stopColor="#33BFFD" />
<stop offset={0.358} stopColor="#28C5F5" />
<stop offset={0.528} stopColor="#15D0E9" />
<stop offset={0.547} stopColor="#12D1E7" />
<stop offset={0.59} stopColor="#1CD2E5" />
<stop offset={0.768} stopColor="#42D8DC" />
<stop offset={0.911} stopColor="#59DBD6" />
<stop offset={1} stopColor="#62DCD4" />
</linearGradient>
<linearGradient
id="h"
x1={15.739}
x2={29.233}
y1={26.703}
y2={26.703}
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#39D2FF" />
<stop offset={0.15} stopColor="#38CEFE" />
<stop offset={0.293} stopColor="#35C3FA" />
<stop offset={0.433} stopColor="#2FB0F3" />
<stop offset={0.547} stopColor="#299AEB" />
<stop offset={0.583} stopColor="#2692EC" />
<stop offset={0.763} stopColor="#1A6CF1" />
<stop offset={0.909} stopColor="#1355F4" />
<stop offset={1} stopColor="#104CF5" />
</linearGradient>
<linearGradient
id="i"
x1={18.23}
x2={18.23}
y1={27.894}
y2={9.79}
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#1B48EF" />
<stop offset={0.122} stopColor="#1C51F0" />
<stop offset={0.321} stopColor="#1E69F5" />
<stop offset={0.568} stopColor="#2190FB" />
<stop offset={1} stopColor="#26B8F4" />
</linearGradient>
<linearGradient
id="j"
x1={18.421}
x2={26.776}
y1={30.045}
y2={21.718}
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#fff" />
<stop offset={0.373} stopColor="#FDFDFD" />
<stop offset={0.507} stopColor="#F6F6F6" />
<stop offset={0.603} stopColor="#EBEBEB" />
<stop offset={0.68} stopColor="#DADADA" />
<stop offset={0.746} stopColor="#C4C4C4" />
<stop offset={0.805} stopColor="#A8A8A8" />
<stop offset={0.858} stopColor="#888" />
<stop offset={0.907} stopColor="#626262" />
<stop offset={0.952} stopColor="#373737" />
<stop offset={0.993} stopColor="#090909" />
<stop offset={1} />
</linearGradient>
<linearGradient
id="k"
x1={18.23}
x2={18.23}
y1={9.469}
y2={27.707}
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#fff" />
<stop offset={0.373} stopColor="#FDFDFD" />
<stop offset={0.507} stopColor="#F6F6F6" />
<stop offset={0.603} stopColor="#EBEBEB" />
<stop offset={0.68} stopColor="#DADADA" />
<stop offset={0.746} stopColor="#C4C4C4" />
<stop offset={0.805} stopColor="#A8A8A8" />
<stop offset={0.858} stopColor="#888" />
<stop offset={0.907} stopColor="#626262" />
<stop offset={0.952} stopColor="#373737" />
<stop offset={0.993} stopColor="#090909" />
<stop offset={1} />
</linearGradient>
<radialGradient
id="c"
cx={0}
cy={0}
r={1}
gradientTransform="rotate(14.036 -132.013 71.177) scale(31.8068)"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#0B31A3" />
<stop offset={1} stopColor="#39A0ED" />
</radialGradient>
<radialGradient
id="d"
cx={0}
cy={0}
r={1}
gradientTransform="rotate(-140.774 10.754 4.54) scale(20.3315)"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#00FFF3" stopOpacity={0.77} />
<stop offset={0.423} stopColor="#00FFF3" stopOpacity={0.72} />
<stop offset={1} stopColor="#5BDCD6" stopOpacity={0} />
</radialGradient>
<clipPath id="e">
<path fill="#fff" d="M11.2 9.2h21.6v21.6H11.2Z" />
</clipPath>
<filter
id="f"
width={21.6}
height={24.3}
x={11.2}
y={9.2}
colorInterpolationFilters="sRGB"
filterUnits="userSpaceOnUse"
>
<feFlood floodOpacity={0} result="BackgroundImageFix" />
<feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape" />
<feColorMatrix
in="SourceAlpha"
result="hardAlpha"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
/>
<feOffset dy={2.7} />
<feGaussianBlur stdDeviation={4.388} />
<feComposite in2="hardAlpha" k2={-1} k3={1} operator="arithmetic" />
<feColorMatrix values="0 0 0 0 0.81875 0 0 0 0 0.824081 0 0 0 0 1 0 0 0 0.37 0" />
<feBlend in2="shape" result="effect1_innerShadow_1360_20280" />
</filter>
</defs>
<path
fill="url(#a)"
d="M16 .005C24.836.005 32 7.166 32 16s-7.164 15.996-16 15.996c-1.779 0-3.516-.292-5.158-.85-1.509-.513-3.127-.754-4.669-.353l-4.468 1.163a1.36 1.36 0 0 1-1.66-1.659l1.162-4.46c.402-1.543.16-3.163-.355-4.673A15.982 15.98 0 0 1 0 16C0 7.166 7.164.005 16 .005Z"
style={{
display: 'inline',
fill: '#000',
fillOpacity: 0.849858,
strokeWidth: 0.888825,
}}
/>
<g strokeWidth={1.5}>
<path
stroke="url(#b)"
d="M5.729 37.224a.78.78 0 0 1-.951-.951l1.306-5.018c.503-1.932.19-3.915-.415-5.69a17.23 17.23 0 0 1-.919-5.568C4.75 10.472 12.473 2.75 22 2.75c9.527 0 17.25 7.722 17.25 17.247 0 9.526-7.723 17.248-17.25 17.248-1.919 0-3.792-.314-5.561-.916-1.774-.604-3.754-.915-5.683-.413z"
style={{
display: 'inline',
fill: 'none',
stroke: 'url(#b)',
}}
transform="matrix(.88887 0 0 .88875 -3.556 -1.773)"
/>
<path
stroke="url(#c)"
strokeOpacity={0.6}
d="M5.729 37.224a.78.78 0 0 1-.951-.951l1.306-5.018c.503-1.932.19-3.915-.415-5.69a17.23 17.23 0 0 1-.919-5.568C4.75 10.472 12.473 2.75 22 2.75c9.527 0 17.25 7.722 17.25 17.247 0 9.526-7.723 17.248-17.25 17.248-1.919 0-3.792-.314-5.561-.916-1.774-.604-3.754-.915-5.683-.413z"
style={{
display: 'inline',
fill: 'none',
stroke: 'url(#c)',
}}
transform="matrix(.88887 0 0 .88875 -3.556 -1.773)"
/>
<path
stroke="url(#d)"
strokeOpacity={0.8}
d="M5.729 37.224a.78.78 0 0 1-.951-.951l1.306-5.018c.503-1.932.19-3.915-.415-5.69a17.23 17.23 0 0 1-.919-5.568C4.75 10.472 12.473 2.75 22 2.75c9.527 0 17.25 7.722 17.25 17.247 0 9.526-7.723 17.248-17.25 17.248-1.919 0-3.792-.314-5.561-.916-1.774-.604-3.754-.915-5.683-.413z"
style={{
display: 'inline',
fill: 'none',
stroke: 'url(#d)',
}}
transform="matrix(.88887 0 0 .88875 -3.556 -1.773)"
/>
</g>
<g
clipPath="url(#e)"
filter="url(#f)"
transform="matrix(.88889 0 0 .88876 -3.555 -1.773)"
style={{
fill: 'none',
}}
>
<path
fill="url(#g)"
d="M30.1 23.08a5.706 5.706 0 0 1-1.529 3.9 2.582 2.582 0 0 0 .562-1.009c.01-.037.02-.074.028-.112a.244.244 0 0 0 .004-.013c.01-.037.016-.074.023-.111.007-.039.015-.078.02-.116v-.003a2.48 2.48 0 0 0 .026-.364 2.563 2.563 0 0 0-.786-1.856 2.55 2.55 0 0 0-1.143-.643l-.006-.001-.046-.016-.665-.23-1.74-.6c-.006-.002-.013-.002-.017-.004l-.109-.04a1.616 1.616 0 0 1-.82-.723l-.636-1.626-.727-1.862-.14-.359-.036-.073a.826.826 0 0 1-.061-.314c0-.028 0-.057.003-.083a.814.814 0 0 1 1.123-.666l3.242 1.668.64.328c.338.202.654.44.942.708a5.715 5.715 0 0 1 1.847 4.22z"
style={{
display: 'inline',
fill: 'url(#g)',
}}
/>
<path
fill="url(#h)"
d="M29.233 25.252c0 .166-.016.326-.045.483a2.747 2.747 0 0 1-.13.452c-.014.037-.03.073-.045.11a2.61 2.61 0 0 1-.443.683c-.472.525-2.076 1.46-2.668 1.84l-1.313.805c-.961.594-1.87 1.015-3.017 1.044l-.16.003a5.71 5.71 0 0 1-4.83-2.67 5.666 5.666 0 0 1-.843-2.387 2.53 2.53 0 0 0 3.703 1.783l.129-.078.522-.31.666-.394v-.019l.085-.051 5.952-3.538.458-.272.045.015.006.002a2.55 2.55 0 0 1 1.389.917 2.577 2.577 0 0 1 .54 1.582z"
style={{
display: 'inline',
fill: 'url(#h)',
}}
/>
<path
fill="url(#i)"
d="m20.76 13.446-.002 13.17-.665.395-.523.309-.129.078-.008.004a2.528 2.528 0 0 1-3.734-2.263V10.318a.849.849 0 0 1 1.32-.705l2.59 1.697c.013.012.029.022.045.032a2.543 2.543 0 0 1 1.106 2.104z"
style={{
display: 'inline',
fill: 'url(#i)',
}}
/>
<path
fill="url(#j)"
d="M29.233 25.252c0 .166-.016.326-.045.483a2.747 2.747 0 0 1-.13.452c-.014.037-.03.073-.045.11a2.587 2.587 0 0 1-.443.683c-.472.525-2.076 1.46-2.668 1.84l-1.313.805c-.961.594-1.87 1.015-3.017 1.044l-.16.003a5.71 5.71 0 0 1-4.83-2.67 5.666 5.666 0 0 1-.843-2.387 2.53 2.53 0 0 0 3.703 1.783l.129-.078.522-.31.666-.394v-.019l.085-.051 5.952-3.538.458-.272.045.015.006.002a2.55 2.55 0 0 1 1.389.917 2.577 2.577 0 0 1 .54 1.582z"
opacity={0.15}
style={{
display: 'inline',
fill: 'url(#j)',
}}
/>
<path
fill="url(#k)"
d="m20.76 13.446-.002 13.17-.665.395-.523.309-.129.078-.008.004a2.528 2.528 0 0 1-3.734-2.263V10.318a.849.849 0 0 1 1.32-.705l2.59 1.697c.013.012.029.022.045.032a2.543 2.543 0 0 1 1.106 2.104z"
opacity={0.1}
style={{
display: 'inline',
fill: 'url(#k)',
}}
/>
</g>
</svg>
);
}

View file

@ -1,17 +0,0 @@
import React from 'react';
export default function OGBingIcon() {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 233297 333333"
shapeRendering="geometricPrecision"
textRendering="geometricPrecision"
imageRendering="optimizeQuality"
fillRule="evenodd"
clipRule="evenodd"
>
<path d="M66076 24207L0 0v296870l66808 36463 166489-96121v-75473L85570 110231l28282 71638 46118 22078-93894 53833z" />
</svg>
);
}

View file

@ -33,7 +33,6 @@ export { default as MinimalPlugin } from './MinimalPlugin';
export { default as AzureMinimalIcon } from './AzureMinimalIcon'; export { default as AzureMinimalIcon } from './AzureMinimalIcon';
export { default as OpenAIMinimalIcon } from './OpenAIMinimalIcon'; export { default as OpenAIMinimalIcon } from './OpenAIMinimalIcon';
export { default as ChatGPTMinimalIcon } from './ChatGPTMinimalIcon'; export { default as ChatGPTMinimalIcon } from './ChatGPTMinimalIcon';
export { default as BingAIMinimalIcon } from './BingAIMinimalIcon';
export { default as PaLMinimalIcon } from './PaLMinimalIcon'; export { default as PaLMinimalIcon } from './PaLMinimalIcon';
export { default as PaLMIcon } from './PaLMIcon'; export { default as PaLMIcon } from './PaLMIcon';
export { default as CodeyIcon } from './CodeyIcon'; export { default as CodeyIcon } from './CodeyIcon';

View file

@ -130,9 +130,6 @@ export default function useChatHelpers(index = 0, paramId?: string) {
setSiblingIdx(0); setSiblingIdx(0);
}; };
const [showBingToneSetting, setShowBingToneSetting] = useRecoilState(
store.showBingToneSettingFamily(index),
);
const [showPopover, setShowPopover] = useRecoilState(store.showPopoverFamily(index)); const [showPopover, setShowPopover] = useRecoilState(store.showPopoverFamily(index));
const [abortScroll, setAbortScroll] = useRecoilState(store.abortScrollFamily(index)); const [abortScroll, setAbortScroll] = useRecoilState(store.abortScrollFamily(index));
const [preset, setPreset] = useRecoilState(store.presetByIndex(index)); const [preset, setPreset] = useRecoilState(store.presetByIndex(index));
@ -166,8 +163,6 @@ export default function useChatHelpers(index = 0, paramId?: string) {
setShowPopover, setShowPopover,
abortScroll, abortScroll,
setAbortScroll, setAbortScroll,
showBingToneSetting,
setShowBingToneSetting,
preset, preset,
setPreset, setPreset,
optionSettings, optionSettings,

View file

@ -29,7 +29,6 @@ export default function useClearStates() {
reset(store.isSubmittingFamily(key)); reset(store.isSubmittingFamily(key));
reset(store.optionSettingsFamily(key)); reset(store.optionSettingsFamily(key));
reset(store.showAgentSettingsFamily(key)); reset(store.showAgentSettingsFamily(key));
reset(store.showBingToneSettingFamily(key));
reset(store.showPopoverFamily(key)); reset(store.showPopoverFamily(key));
reset(store.showMentionPopoverFamily(key)); reset(store.showMentionPopoverFamily(key));
reset(store.showPlusPopoverFamily(key)); reset(store.showPlusPopoverFamily(key));

View file

@ -1,7 +1,6 @@
import debounce from 'lodash/debounce'; import debounce from 'lodash/debounce';
import { useEffect, useRef, useCallback } from 'react'; import { useEffect, useRef, useCallback } from 'react';
import { useRecoilValue, useRecoilState } from 'recoil'; import { useRecoilValue, useRecoilState } from 'recoil';
import { Constants } from 'librechat-data-provider';
import type { TEndpointOption } from 'librechat-data-provider'; import type { TEndpointOption } from 'librechat-data-provider';
import type { KeyboardEvent } from 'react'; import type { KeyboardEvent } from 'react';
import { import {
@ -43,18 +42,11 @@ export default function useTextarea({
const checkHealth = useInteractionHealthCheck(); const checkHealth = useInteractionHealthCheck();
const enterToSend = useRecoilValue(store.enterToSend); const enterToSend = useRecoilValue(store.enterToSend);
const { const { index, conversation, isSubmitting, filesLoading, latestMessage, setFilesLoading } =
index, useChatContext();
conversation,
isSubmitting,
filesLoading,
latestMessage,
setFilesLoading,
setShowBingToneSetting,
} = useChatContext();
const [activePrompt, setActivePrompt] = useRecoilState(store.activePromptByIndex(index)); const [activePrompt, setActivePrompt] = useRecoilState(store.activePromptByIndex(index));
const { conversationId, jailbreak = false, endpoint = '' } = conversation || {}; const { endpoint = '' } = conversation || {};
const { entity, isAgent, isAssistant } = getEntity({ const { entity, isAgent, isAssistant } = getEntity({
endpoint, endpoint,
agentsMap, agentsMap,
@ -78,33 +70,6 @@ export default function useTextarea({
} }
}, [activePrompt, setActivePrompt, textAreaRef]); }, [activePrompt, setActivePrompt, textAreaRef]);
// auto focus to input, when enter a conversation.
useEffect(() => {
const convoId = conversationId ?? '';
if (!convoId) {
return;
}
// Prevents Settings from not showing on new conversation, also prevents showing toneStyle change without jailbreak
if (convoId === Constants.NEW_CONVO || !jailbreak) {
setShowBingToneSetting(false);
}
if (convoId !== Constants.SEARCH) {
textAreaRef.current?.focus();
}
// setShowBingToneSetting is a recoil setter, so it doesn't need to be in the dependency array
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [conversationId, jailbreak]);
useEffect(() => {
const timeoutId = setTimeout(() => {
textAreaRef.current?.focus();
}, 100);
return () => clearTimeout(timeoutId);
}, [isSubmitting, textAreaRef]);
useEffect(() => { useEffect(() => {
const currentValue = textAreaRef.current?.value ?? ''; const currentValue = textAreaRef.current?.value ?? '';
if (currentValue) { if (currentValue) {

View file

@ -53,7 +53,6 @@ export default function useGenerationsByLatest({
EModelEndpoint.bedrock, EModelEndpoint.bedrock,
EModelEndpoint.chatGPTBrowser, EModelEndpoint.chatGPTBrowser,
EModelEndpoint.google, EModelEndpoint.google,
EModelEndpoint.bingAI,
EModelEndpoint.gptPlugins, EModelEndpoint.gptPlugins,
EModelEndpoint.anthropic, EModelEndpoint.anthropic,
].find((e) => e === endpoint), ].find((e) => e === endpoint),

View file

@ -8,6 +8,7 @@ import { useNavigate } from 'react-router-dom';
import { import {
Constants, Constants,
FileSources, FileSources,
EModelEndpoint,
isParamEndpoint, isParamEndpoint,
LocalStorageKeys, LocalStorageKeys,
isAssistantsEndpoint, isAssistantsEndpoint,
@ -70,6 +71,7 @@ const useNewConvo = (index = 0) => {
buildDefault?: boolean, buildDefault?: boolean,
keepLatestMessage?: boolean, keepLatestMessage?: boolean,
keepAddedConvos?: boolean, keepAddedConvos?: boolean,
disableFocus?: boolean,
) => { ) => {
const modelsConfig = modelsData ?? modelsQuery.data; const modelsConfig = modelsData ?? modelsQuery.data;
const { endpoint = null } = conversation; const { endpoint = null } = conversation;
@ -87,11 +89,15 @@ const useNewConvo = (index = 0) => {
: preset; : preset;
if (buildDefaultConversation) { if (buildDefaultConversation) {
const defaultEndpoint = getDefaultEndpoint({ let defaultEndpoint = getDefaultEndpoint({
convoSetup: activePreset ?? conversation, convoSetup: activePreset ?? conversation,
endpointsConfig, endpointsConfig,
}); });
if (!defaultEndpoint) {
defaultEndpoint = Object.keys(endpointsConfig ?? {})[0] as EModelEndpoint;
}
const endpointType = getEndpointField(endpointsConfig, defaultEndpoint, 'type'); const endpointType = getEndpointField(endpointsConfig, defaultEndpoint, 'type');
if (!conversation.endpointType && endpointType) { if (!conversation.endpointType && endpointType) {
conversation.endpointType = endpointType; conversation.endpointType = endpointType;
@ -161,6 +167,9 @@ const useNewConvo = (index = 0) => {
} }
clearTimeout(timeoutIdRef.current); clearTimeout(timeoutIdRef.current);
if (disableFocus === true) {
return;
}
timeoutIdRef.current = setTimeout(() => { timeoutIdRef.current = setTimeout(() => {
const textarea = document.getElementById(mainTextareaId); const textarea = document.getElementById(mainTextareaId);
if (textarea) { if (textarea) {
@ -176,6 +185,7 @@ const useNewConvo = (index = 0) => {
template: _template = {}, template: _template = {},
preset: _preset, preset: _preset,
modelsData, modelsData,
disableFocus,
buildDefault = true, buildDefault = true,
keepLatestMessage = false, keepLatestMessage = false,
keepAddedConvos = false, keepAddedConvos = false,
@ -184,6 +194,7 @@ const useNewConvo = (index = 0) => {
preset?: Partial<TPreset>; preset?: Partial<TPreset>;
modelsData?: TModelsConfig; modelsData?: TModelsConfig;
buildDefault?: boolean; buildDefault?: boolean;
disableFocus?: boolean;
keepLatestMessage?: boolean; keepLatestMessage?: boolean;
keepAddedConvos?: boolean; keepAddedConvos?: boolean;
} = {}) { } = {}) {
@ -254,6 +265,7 @@ const useNewConvo = (index = 0) => {
buildDefault, buildDefault,
keepLatestMessage, keepLatestMessage,
keepAddedConvos, keepAddedConvos,
disableFocus,
); );
}, },
[ [

View file

@ -8,7 +8,6 @@ const defaultConfig: TEndpointsConfig = {
[EModelEndpoint.assistants]: null, [EModelEndpoint.assistants]: null,
[EModelEndpoint.agents]: null, [EModelEndpoint.agents]: null,
[EModelEndpoint.openAI]: null, [EModelEndpoint.openAI]: null,
[EModelEndpoint.bingAI]: null,
[EModelEndpoint.chatGPTBrowser]: null, [EModelEndpoint.chatGPTBrowser]: null,
[EModelEndpoint.gptPlugins]: null, [EModelEndpoint.gptPlugins]: null,
[EModelEndpoint.google]: null, [EModelEndpoint.google]: null,
@ -30,7 +29,7 @@ const plugins = selector({
key: 'plugins', key: 'plugins',
get: ({ get }) => { get: ({ get }) => {
const config = get(endpointsConfig) || {}; const config = get(endpointsConfig) || {};
return config?.gptPlugins?.plugins || {}; return config.gptPlugins?.plugins || {};
}, },
}); });

View file

@ -184,11 +184,6 @@ const showAgentSettingsFamily = atomFamily({
default: false, default: false,
}); });
const showBingToneSettingFamily = atomFamily({
key: 'showBingToneSettingByIndex',
default: false,
});
const showPopoverFamily = atomFamily({ const showPopoverFamily = atomFamily({
key: 'showPopoverByIndex', key: 'showPopoverByIndex',
default: false, default: false,
@ -385,7 +380,6 @@ export default {
isSubmittingFamily, isSubmittingFamily,
optionSettingsFamily, optionSettingsFamily,
showAgentSettingsFamily, showAgentSettingsFamily,
showBingToneSettingFamily,
showPopoverFamily, showPopoverFamily,
latestMessageFamily, latestMessageFamily,
messagesSiblingIdxFamily, messagesSiblingIdxFamily,

View file

@ -14,7 +14,6 @@ const staticAtoms = {
key: 'currentSettingsView', key: 'currentSettingsView',
default: SettingsViews.default, default: SettingsViews.default,
}), }),
showBingToneSetting: atom<boolean>({ key: 'showBingToneSetting', default: false }),
showPopover: atom<boolean>({ key: 'showPopover', default: false }), showPopover: atom<boolean>({ key: 'showPopover', default: false }),
}; };

View file

@ -256,18 +256,12 @@ export function storeEndpointSettings(conversation: TConversation | null) {
if (!conversation) { if (!conversation) {
return; return;
} }
const { endpoint, model, agentOptions, jailbreak, toneStyle } = conversation; const { endpoint, model, agentOptions } = conversation;
if (!endpoint) { if (!endpoint) {
return; return;
} }
if (endpoint === EModelEndpoint.bingAI) {
const settings = { jailbreak, toneStyle };
localStorage.setItem(LocalStorageKeys.LAST_BING, JSON.stringify(settings));
return;
}
const lastModel = JSON.parse(localStorage.getItem(LocalStorageKeys.LAST_MODEL) ?? '{}'); const lastModel = JSON.parse(localStorage.getItem(LocalStorageKeys.LAST_MODEL) ?? '{}');
lastModel[endpoint] = model; lastModel[endpoint] = model;

View file

@ -26,10 +26,6 @@ describe('getEndpointField', () => {
expect(getEndpointField(mockEndpointsConfig, undefined, 'type')).toBeUndefined(); expect(getEndpointField(mockEndpointsConfig, undefined, 'type')).toBeUndefined();
}); });
it('returns undefined if the endpoint does not exist in endpointsConfig', () => {
expect(getEndpointField(mockEndpointsConfig, EModelEndpoint.bingAI, 'type')).toBeUndefined();
});
it('returns the correct value for a valid endpoint and property', () => { it('returns the correct value for a valid endpoint and property', () => {
expect(getEndpointField(mockEndpointsConfig, EModelEndpoint.openAI, 'order')).toEqual(0); expect(getEndpointField(mockEndpointsConfig, EModelEndpoint.openAI, 'order')).toEqual(0);
expect(getEndpointField(mockEndpointsConfig, EModelEndpoint.google, 'iconURL')).toEqual( expect(getEndpointField(mockEndpointsConfig, EModelEndpoint.google, 'iconURL')).toEqual(

View file

@ -1,8 +1,8 @@
import type { import type {
TConversation,
TPreset, TPreset,
TEndpointsConfig, TConversation,
EModelEndpoint, EModelEndpoint,
TEndpointsConfig,
} from 'librechat-data-provider'; } from 'librechat-data-provider';
import { getLocalStorageItems } from './localStorage'; import { getLocalStorageItems } from './localStorage';
import { mapEndpoints } from './endpoints'; import { mapEndpoints } from './endpoints';
@ -14,11 +14,11 @@ type TDefaultEndpoint = { convoSetup: TConvoSetup; endpointsConfig: TEndpointsCo
const getEndpointFromSetup = ( const getEndpointFromSetup = (
convoSetup: TConvoSetup | null, convoSetup: TConvoSetup | null,
endpointsConfig: TEndpointsConfig, endpointsConfig: TEndpointsConfig,
) => { ): EModelEndpoint | null => {
let { endpoint: targetEndpoint = '' } = convoSetup || {}; let { endpoint: targetEndpoint = '' } = convoSetup || {};
targetEndpoint = targetEndpoint ?? ''; targetEndpoint = targetEndpoint ?? '';
if (targetEndpoint && endpointsConfig?.[targetEndpoint]) { if (targetEndpoint && endpointsConfig?.[targetEndpoint]) {
return targetEndpoint; return targetEndpoint as EModelEndpoint;
} else if (targetEndpoint) { } else if (targetEndpoint) {
console.warn(`Illegal target endpoint ${targetEndpoint} ${endpointsConfig}`); console.warn(`Illegal target endpoint ${targetEndpoint} ${endpointsConfig}`);
} }
@ -54,9 +54,9 @@ const getDefinedEndpoint = (endpointsConfig: TEndpointsConfig) => {
const getDefaultEndpoint = ({ const getDefaultEndpoint = ({
convoSetup, convoSetup,
endpointsConfig, endpointsConfig,
}: TDefaultEndpoint): EModelEndpoint | string | undefined => { }: TDefaultEndpoint): EModelEndpoint | undefined => {
return ( return (
(getEndpointFromSetup(convoSetup, endpointsConfig) ?? '') || getEndpointFromSetup(convoSetup, endpointsConfig) ||
getEndpointFromLocalStorage(endpointsConfig) || getEndpointFromLocalStorage(endpointsConfig) ||
getDefinedEndpoint(endpointsConfig) getDefinedEndpoint(endpointsConfig)
); );

View file

@ -20,7 +20,6 @@ export { default as logger } from './logger';
export { default as buildTree } from './buildTree'; export { default as buildTree } from './buildTree';
export { default as getLoginError } from './getLoginError'; export { default as getLoginError } from './getLoginError';
export { default as cleanupPreset } from './cleanupPreset'; export { default as cleanupPreset } from './cleanupPreset';
export { default as validateIframe } from './validateIframe';
export { default as buildDefaultConvo } from './buildDefaultConvo'; export { default as buildDefaultConvo } from './buildDefaultConvo';
export { default as getDefaultEndpoint } from './getDefaultEndpoint'; export { default as getDefaultEndpoint } from './getDefaultEndpoint';

View file

@ -12,11 +12,9 @@ export const getPresetTitle = (preset: TPreset, mention?: boolean) => {
promptPrefix, promptPrefix,
chatGptLabel, chatGptLabel,
modelLabel, modelLabel,
jailbreak,
toneStyle,
} = preset; } = preset;
const modelInfo = model ?? '';
let title = ''; let title = '';
let modelInfo = model ?? '';
let label = ''; let label = '';
const usesChatGPTLabel: TEndpoints = [ const usesChatGPTLabel: TEndpoints = [
@ -30,11 +28,7 @@ export const getPresetTitle = (preset: TPreset, mention?: boolean) => {
label = chatGptLabel ?? ''; label = chatGptLabel ?? '';
} else if (endpoint != null && endpoint && usesModelLabel.includes(endpoint)) { } else if (endpoint != null && endpoint && usesModelLabel.includes(endpoint)) {
label = modelLabel ?? ''; label = modelLabel ?? '';
} else if (endpoint === EModelEndpoint.bingAI) {
modelInfo = jailbreak === true ? 'Sydney' : modelInfo;
label = toneStyle != null && toneStyle ? `: ${toneStyle}` : '';
} }
if ( if (
label && label &&
presetTitle != null && presetTitle != null &&

View file

@ -1,44 +0,0 @@
export default function validateIframe(content: string): boolean {
const hasValidIframe =
content.includes('<iframe role="presentation" style="') &&
content.includes('src="https://www.bing.com/images/create');
if (!hasValidIframe) {
return false;
}
const iframeRegex = /<iframe\s[^>]*?>/g;
const iframeMatches = content.match(iframeRegex);
if (!iframeMatches || iframeMatches.length > 1) {
return false;
}
const parser = new DOMParser();
const parsedHtml = parser.parseFromString(content, 'text/html');
const potentiallyHarmfulTags = ['script', 'img', 'style', 'div', 'a', 'input', 'button', 'form'];
for (const tag of potentiallyHarmfulTags) {
const elements = parsedHtml.getElementsByTagName(tag);
if (elements.length > 0) {
return false;
}
}
const iframes = parsedHtml.getElementsByTagName('iframe');
if (iframes.length !== 1) {
return false;
}
const iframe = iframes[0];
// Verify role and src attributes
const role = iframe.getAttribute('role');
const src = iframe.getAttribute('src');
return (
role === 'presentation' && src != null && src.startsWith('https://www.bing.com/images/create')
);
}

View file

@ -51,7 +51,7 @@ test.describe('Key suite', () => {
test('Test Setting and Revoking Keys from Settings', async ({ page }) => { test('Test Setting and Revoking Keys from Settings', async ({ page }) => {
await page.goto('http://localhost:3080/', { timeout: 5000 }); await page.goto('http://localhost:3080/', { timeout: 5000 });
const endpoint = 'bingAI'; const endpoint = 'openAI';
const newTopicButton = page.getByTestId('new-conversation-menu'); const newTopicButton = page.getByTestId('new-conversation-menu');
await newTopicButton.click(); await newTopicButton.click();

View file

@ -3,7 +3,7 @@ import type { Response, Page, BrowserContext } from '@playwright/test';
const basePath = 'http://localhost:3080/c/'; const basePath = 'http://localhost:3080/c/';
const initialUrl = `${basePath}new`; const initialUrl = `${basePath}new`;
const endpoints = ['google', 'openAI', 'azureOpenAI', 'bingAI', 'chatGPTBrowser', 'gptPlugins']; const endpoints = ['google', 'openAI', 'azureOpenAI', 'chatGPTBrowser', 'gptPlugins'];
const endpoint = endpoints[1]; const endpoint = endpoints[1];
function isUUID(uuid: string) { function isUUID(uuid: string) {

View file

@ -1,7 +1,7 @@
import { expect, test } from '@playwright/test'; import { expect, test } from '@playwright/test';
test.describe('Settings suite', () => { test.describe('Settings suite', () => {
test('Last Bing settings', async ({ page }) => { test('Last OpenAI settings', async ({ page }) => {
await page.goto('http://localhost:3080/', { timeout: 5000 }); await page.goto('http://localhost:3080/', { timeout: 5000 });
await page.evaluate(() => await page.evaluate(() =>
window.localStorage.setItem( window.localStorage.setItem(
@ -9,17 +9,9 @@ test.describe('Settings suite', () => {
JSON.stringify({ JSON.stringify({
conversationId: 'new', conversationId: 'new',
title: 'New Chat', title: 'New Chat',
endpoint: 'bingAI', endpoint: 'openAI',
createdAt: '', createdAt: '',
updatedAt: '', updatedAt: '',
jailbreak: false,
context: null,
systemMessage: null,
toneStyle: 'creative',
jailbreakConversationId: null,
conversationSignature: null,
clientId: null,
invocationId: 1,
}), }),
), ),
); );
@ -27,13 +19,13 @@ test.describe('Settings suite', () => {
const initialLocalStorage = await page.evaluate(() => window.localStorage); const initialLocalStorage = await page.evaluate(() => window.localStorage);
const lastConvoSetup = JSON.parse(initialLocalStorage.lastConversationSetup); const lastConvoSetup = JSON.parse(initialLocalStorage.lastConversationSetup);
expect(lastConvoSetup.endpoint).toEqual('bingAI'); expect(lastConvoSetup.endpoint).toEqual('openAI');
const newTopicButton = page.getByTestId('new-conversation-menu'); const newTopicButton = page.getByTestId('new-conversation-menu');
await newTopicButton.click(); await newTopicButton.click();
// includes the icon + endpoint names in obj property // includes the icon + endpoint names in obj property
const endpointItem = page.getByTestId('endpoint-item-bingAI'); const endpointItem = page.getByTestId('endpoint-item-openAI');
await endpointItem.click(); await endpointItem.click();
await page.getByTestId('text-input').click(); await page.getByTestId('text-input').click();
@ -65,10 +57,6 @@ test.describe('Settings suite', () => {
// Check if the settings persisted // Check if the settings persisted
const localStorage = await page.evaluate(() => window.localStorage); const localStorage = await page.evaluate(() => window.localStorage);
const lastBingSettings = JSON.parse(localStorage.lastBingSettings);
const { jailbreak, toneStyle } = lastBingSettings;
expect(jailbreak).toBeTruthy();
expect(toneStyle).toEqual('balanced');
const button = page.getByRole('button', { name: 'Mode: Sydney' }); const button = page.getByRole('button', { name: 'Mode: Sydney' });
expect(button.count()).toBeTruthy(); expect(button.count()).toBeTruthy();
}); });

View file

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

View file

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

View file

@ -24,8 +24,6 @@ export enum EModelEndpoint {
custom = 'custom', custom = 'custom',
bedrock = 'bedrock', bedrock = 'bedrock',
/** @deprecated */ /** @deprecated */
bingAI = 'bingAI',
/** @deprecated */
chatGPTBrowser = 'chatGPTBrowser', chatGPTBrowser = 'chatGPTBrowser',
/** @deprecated */ /** @deprecated */
gptPlugins = 'gptPlugins', gptPlugins = 'gptPlugins',
@ -592,25 +590,6 @@ export const tConversationSchema = z.object({
greeting: z.string().optional(), greeting: z.string().optional(),
spec: z.string().nullable().optional(), spec: z.string().nullable().optional(),
iconURL: 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 */ /** @deprecated */
resendImages: z.boolean().optional(), resendImages: z.boolean().optional(),
/** @deprecated */ /** @deprecated */
@ -816,41 +795,6 @@ export const googleGenConfigSchema = z
.strip() .strip()
.optional(); .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 export const chatGPTBrowserSchema = tConversationSchema
.pick({ .pick({
model: true, model: true,