Show OpenRouter icon

This commit is contained in:
Cohee 2023-08-15 21:36:28 +03:00
parent 869478627d
commit 4a0c93f023
2 changed files with 28 additions and 2 deletions

14
public/img/openrouter.svg Normal file
View File

@ -0,0 +1,14 @@
<svg width="100%" height="100%" viewBox="0 0 512 512"
xmlns="http://www.w3.org/2000/svg" class="Navbar_logo__INhgK" aria-label="Logo">
<g clip-path="url(#clip0_205_3)">
<path d="M3 248.945C18 248.945 76 236 106 219C136 202 136 202 198 158C276.497 102.293 332 120.945 423 120.945" stroke-width="90"></path>
<path d="M511 121.5L357.25 210.268L357.25 32.7324L511 121.5Z"></path>
<path d="M0 249C15 249 73 261.945 103 278.945C133 295.945 133 295.945 195 339.945C273.497 395.652 329 377 420 377" stroke-width="90"></path>
<path d="M508 376.445L354.25 287.678L354.25 465.213L508 376.445Z"></path>
</g>
<defs>
<clipPath id="clip0_205_3">
<rect width="512" height="512"></rect>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 777 B

View File

@ -1369,9 +1369,21 @@ function messageFormatting(mes, ch_name, isSystem, isUser) {
function insertSVGIcon(mes, extra) {
// Determine the SVG filename
let modelName;
if (extra.api === "openai" && extra.model.toLowerCase().includes("claude")) {
// Claude on OpenRouter or Anthropic
if (extra.api === "openai" && extra.model?.toLowerCase().includes("claude")) {
modelName = "claude";
} else {
}
// OpenAI on OpenRouter
else if (extra.api === "openai" && extra.model?.toLowerCase().includes("openai")) {
modelName = "openai";
}
// OpenRouter website model or other models
else if (extra.api === "openai" && (extra.model === null || extra.model?.toLowerCase().includes("/"))) {
modelName = "openrouter";
}
// Everything else
else {
modelName = extra.api;
}