diff --git a/app/components/emoji.tsx b/app/components/emoji.tsx index 54d1c1c99..6686d8731 100644 --- a/app/components/emoji.tsx +++ b/app/components/emoji.tsx @@ -6,8 +6,21 @@ import EmojiPicker, { import { ModelType } from "../store"; -import BotIcon from "../icons/bot.svg"; -import BlackBotIcon from "../icons/black-bot.svg"; +import BotIconDefault from "../icons/llm-icons/default.svg"; +import BotIconOpenAI from "../icons/llm-icons/openai.svg"; +import BotIconGemini from "../icons/llm-icons/gemini.svg"; +import BotIconGemma from "../icons/llm-icons/gemma.svg"; +import BotIconClaude from "../icons/llm-icons/claude.svg"; +import BotIconMeta from "../icons/llm-icons/meta.svg"; +import BotIconMistral from "../icons/llm-icons/mistral.svg"; +import BotIconDeepseek from "../icons/llm-icons/deepseek.svg"; +import BotIconMoonshot from "../icons/llm-icons/moonshot.svg"; +import BotIconQwen from "../icons/llm-icons/qwen.svg"; +import BotIconWenxin from "../icons/llm-icons/wenxin.svg"; +import BotIconGrok from "../icons/llm-icons/grok.svg"; +import BotIconHunyuan from "../icons/llm-icons/hunyuan.svg"; +import BotIconDoubao from "../icons/llm-icons/doubao.svg"; +import BotIconChatglm from "../icons/llm-icons/chatglm.svg"; export function getEmojiUrl(unified: string, style: EmojiStyle) { // Whoever owns this Content Delivery Network (CDN), I am using your CDN to serve emojis @@ -33,17 +46,49 @@ export function AvatarPicker(props: { } export function Avatar(props: { model?: ModelType; avatar?: string }) { + let LlmIcon = BotIconDefault; + if (props.model) { + const modelName = props.model.toLowerCase(); + + if ( + modelName.startsWith("gpt") || + modelName.startsWith("chatgpt") || + modelName.startsWith("o1") || + modelName.startsWith("o3") + ) { + LlmIcon = BotIconOpenAI; + } else if (modelName.startsWith("gemini")) { + LlmIcon = BotIconGemini; + } else if (modelName.startsWith("gemma")) { + LlmIcon = BotIconGemma; + } else if (modelName.startsWith("claude")) { + LlmIcon = BotIconClaude; + } else if (modelName.startsWith("llama")) { + LlmIcon = BotIconMeta; + } else if (modelName.startsWith("mixtral")) { + LlmIcon = BotIconMistral; + } else if (modelName.startsWith("deepseek")) { + LlmIcon = BotIconDeepseek; + } else if (modelName.startsWith("moonshot")) { + LlmIcon = BotIconMoonshot; + } else if (modelName.startsWith("qwen")) { + LlmIcon = BotIconQwen; + } else if (modelName.startsWith("ernie")) { + LlmIcon = BotIconWenxin; + } else if (modelName.startsWith("grok")) { + LlmIcon = BotIconGrok; + } else if (modelName.startsWith("hunyuan")) { + LlmIcon = BotIconHunyuan; + } else if (modelName.startsWith("doubao")) { + LlmIcon = BotIconDoubao; + } else if (modelName.startsWith("glm")) { + LlmIcon = BotIconChatglm; + } + return (
- {props.model?.startsWith("gpt-4") || - props.model?.startsWith("chatgpt-4o") || - props.model?.startsWith("o1") || - props.model?.startsWith("o3") ? ( - - ) : ( - - )} +
); } diff --git a/app/components/ui-lib.tsx b/app/components/ui-lib.tsx index a64265235..7b9f5ace0 100644 --- a/app/components/ui-lib.tsx +++ b/app/components/ui-lib.tsx @@ -23,6 +23,7 @@ import React, { useRef, } from "react"; import { IconButton } from "./button"; +import { Avatar } from "./emoji"; import clsx from "clsx"; export function Popover(props: { @@ -522,6 +523,7 @@ export function Selector(props: { key={i} title={item.title} subTitle={item.subTitle} + icon={} onClick={(e) => { if (item.disable) { e.stopPropagation(); diff --git a/app/icons/llm-icons/chatglm.svg b/app/icons/llm-icons/chatglm.svg new file mode 100644 index 000000000..642750f3e --- /dev/null +++ b/app/icons/llm-icons/chatglm.svg @@ -0,0 +1,14 @@ + + ChatGLM + + + + + + + + + + + \ No newline at end of file diff --git a/app/icons/llm-icons/claude.svg b/app/icons/llm-icons/claude.svg new file mode 100644 index 000000000..ca8e447bb --- /dev/null +++ b/app/icons/llm-icons/claude.svg @@ -0,0 +1,8 @@ + + Claude + + + + + \ No newline at end of file diff --git a/app/icons/llm-icons/deepseek.svg b/app/icons/llm-icons/deepseek.svg new file mode 100644 index 000000000..30440e316 --- /dev/null +++ b/app/icons/llm-icons/deepseek.svg @@ -0,0 +1,8 @@ + + DeepSeek + + + + + \ No newline at end of file diff --git a/app/icons/llm-icons/default.svg b/app/icons/llm-icons/default.svg new file mode 100644 index 000000000..2ebff6b3f --- /dev/null +++ b/app/icons/llm-icons/default.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/icons/llm-icons/doubao.svg b/app/icons/llm-icons/doubao.svg new file mode 100644 index 000000000..79b1b822a --- /dev/null +++ b/app/icons/llm-icons/doubao.svg @@ -0,0 +1,14 @@ + + Doubao + + + + + + + + \ No newline at end of file diff --git a/app/icons/llm-icons/gemini.svg b/app/icons/llm-icons/gemini.svg new file mode 100644 index 000000000..587669135 --- /dev/null +++ b/app/icons/llm-icons/gemini.svg @@ -0,0 +1,15 @@ + + Gemini + + + + + + + + + + + + \ No newline at end of file diff --git a/app/icons/llm-icons/gemma.svg b/app/icons/llm-icons/gemma.svg new file mode 100644 index 000000000..daf1a035c --- /dev/null +++ b/app/icons/llm-icons/gemma.svg @@ -0,0 +1,15 @@ + + Gemma + + + + + + + + + + + + \ No newline at end of file diff --git a/app/icons/llm-icons/grok.svg b/app/icons/llm-icons/grok.svg new file mode 100644 index 000000000..335786777 --- /dev/null +++ b/app/icons/llm-icons/grok.svg @@ -0,0 +1,8 @@ + + Grok + + + + + \ No newline at end of file diff --git a/app/icons/llm-icons/hunyuan.svg b/app/icons/llm-icons/hunyuan.svg new file mode 100644 index 000000000..f67930c98 --- /dev/null +++ b/app/icons/llm-icons/hunyuan.svg @@ -0,0 +1,17 @@ + + Hunyuan + + + + + + + + + + + \ No newline at end of file diff --git a/app/icons/llm-icons/meta.svg b/app/icons/llm-icons/meta.svg new file mode 100644 index 000000000..75dc40df7 --- /dev/null +++ b/app/icons/llm-icons/meta.svg @@ -0,0 +1,93 @@ + + Meta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/icons/llm-icons/mistral.svg b/app/icons/llm-icons/mistral.svg new file mode 100644 index 000000000..e577faca5 --- /dev/null +++ b/app/icons/llm-icons/mistral.svg @@ -0,0 +1,15 @@ + + Mistral + + + + + + + + + + + + \ No newline at end of file diff --git a/app/icons/llm-icons/moonshot.svg b/app/icons/llm-icons/moonshot.svg new file mode 100644 index 000000000..8ab682d37 --- /dev/null +++ b/app/icons/llm-icons/moonshot.svg @@ -0,0 +1,8 @@ + + MoonshotAI + + + + + \ No newline at end of file diff --git a/app/icons/llm-icons/openai.svg b/app/icons/llm-icons/openai.svg new file mode 100644 index 000000000..ac4567f87 --- /dev/null +++ b/app/icons/llm-icons/openai.svg @@ -0,0 +1,8 @@ + + OpenAI + + + + + \ No newline at end of file diff --git a/app/icons/llm-icons/qwen.svg b/app/icons/llm-icons/qwen.svg new file mode 100644 index 000000000..857ce2186 --- /dev/null +++ b/app/icons/llm-icons/qwen.svg @@ -0,0 +1,14 @@ + + Qwen + + + + + + + + + + + \ No newline at end of file diff --git a/app/icons/llm-icons/wenxin.svg b/app/icons/llm-icons/wenxin.svg new file mode 100644 index 000000000..0030b0e01 --- /dev/null +++ b/app/icons/llm-icons/wenxin.svg @@ -0,0 +1,18 @@ + + Wenxin + + + + + + + + + + + + + + \ No newline at end of file