Update GPT4 model icon (#274)

This commit is contained in:
David Shin 2023-05-15 23:08:30 +09:00 committed by GitHub
parent 9de7da91a7
commit 9f36e195bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View file

@ -10,6 +10,7 @@ export default function PresetItem({ preset = {}, value, onSelect, onChangePrese
const icon = getIcon({ const icon = getIcon({
size: 20, size: 20,
endpoint: preset?.endpoint, endpoint: preset?.endpoint,
model: preset?.model,
error: false, error: false,
className: 'mr-2' className: 'mr-2'
}); });
@ -21,7 +22,7 @@ export default function PresetItem({ preset = {}, value, onSelect, onChangePrese
const { chatGptLabel, model } = preset; const { chatGptLabel, model } = preset;
if (model) _title += `: ${model}`; if (model) _title += `: ${model}`;
if (chatGptLabel) _title += ` as ${chatGptLabel}`; if (chatGptLabel) _title += ` as ${chatGptLabel}`;
} else if (endpoint === 'google') { } else if (endpoint === 'google') {
const { modelLabel, model } = preset; const { modelLabel, model } = preset;
if (model) _title += `: ${model}`; if (model) _title += `: ${model}`;
if (modelLabel) _title += ` as ${modelLabel}`; if (modelLabel) _title += ` as ${modelLabel}`;

View file

@ -30,15 +30,13 @@ const getIcon = props => {
let icon, bg, name; let icon, bg, name;
if (endpoint === 'azureOpenAI') { if (endpoint === 'azureOpenAI') {
const { chatGptLabel } = props; const { chatGptLabel } = props;
icon = <GPTIcon size={size * 0.7} />; icon = <GPTIcon size={size * 0.7} />;
bg = 'linear-gradient(0.375turn, #61bde2, #4389d0)'; bg = 'linear-gradient(0.375turn, #61bde2, #4389d0)';
name = chatGptLabel || 'ChatGPT'; name = chatGptLabel || 'ChatGPT';
} else if (endpoint === 'openAI') { } else if (endpoint === 'openAI') {
const { chatGptLabel } = props; const { chatGptLabel } = props;
icon = <GPTIcon size={size * 0.7} />; icon = <GPTIcon size={size * 0.7} />;
bg = model && model.toLowerCase() === 'gpt-4' ? 'black' : (chatGptLabel bg = model && model.toLowerCase() === 'gpt-4' ? '#AB68FF' : (chatGptLabel
? `rgba(16, 163, 127, ${button ? 0.75 : 1})` ? `rgba(16, 163, 127, ${button ? 0.75 : 1})`
: `rgba(16, 163, 127, ${button ? 0.75 : 1})`); : `rgba(16, 163, 127, ${button ? 0.75 : 1})`);
name = chatGptLabel || 'ChatGPT'; name = chatGptLabel || 'ChatGPT';
@ -48,13 +46,12 @@ const getIcon = props => {
name = modelLabel || 'PaLM2'; name = modelLabel || 'PaLM2';
} else if (endpoint === 'bingAI') { } else if (endpoint === 'bingAI') {
const { jailbreak } = props; const { jailbreak } = props;
icon = <BingIcon size={size * 0.7} />; icon = <BingIcon size={size * 0.7} />;
bg = jailbreak ? `radial-gradient(circle at 90% 110%, #F0F0FA, #D0E0F9)` : `transparent`; bg = jailbreak ? `radial-gradient(circle at 90% 110%, #F0F0FA, #D0E0F9)` : `transparent`;
name = jailbreak ? 'Sydney' : 'BingAI'; name = jailbreak ? 'Sydney' : 'BingAI';
} else if (endpoint === 'chatGPTBrowser') { } else if (endpoint === 'chatGPTBrowser') {
icon = <GPTIcon size={size * 0.7} />; icon = <GPTIcon size={size * 0.7} />;
bg = model && model.toLowerCase() === 'gpt-4' ? 'black' : `rgba(0, 163, 255, ${button ? 0.75 : 1})`; bg = model && model.toLowerCase() === 'gpt-4' ? '#AB68FF' : `rgba(0, 163, 255, ${button ? 0.75 : 1})`;
name = 'ChatGPT'; name = 'ChatGPT';
} else if (endpoint === null) { } else if (endpoint === null) {
icon = <GPTIcon size={size * 0.7} />; icon = <GPTIcon size={size * 0.7} />;