Skip to content

Commit d4b2f2b

Browse files
committed
add icon for openai compatible, remove label for now
1 parent 77ade98 commit d4b2f2b

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

core/src/env/env.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ var OpenAIEndpoint = os.Getenv("WHODB_OPENAI_ENDPOINT")
4242

4343
var OpenAICompatibleEndpoint = os.Getenv("WHODB_OPENAI_COMPATIBLE_ENDPOINT")
4444
var OpenAICompatibleAPIKey = os.Getenv("WHODB_OPENAI_COMPATIBLE_API_KEY")
45-
var OpenAICompatibleLabel = os.Getenv("WHODB_OPENAI_COMPATIBLE_LABEL")
45+
46+
// var OpenAICompatibleLabel = os.Getenv("WHODB_OPENAI_COMPATIBLE_LABEL")
4647

4748
var CustomModels = common.FilterList(strings.Split(os.Getenv("WHODB_CUSTOM_MODELS"), ","), func(item string) bool {
4849
return strings.TrimSpace(item) != ""
@@ -82,10 +83,6 @@ func GetConfiguredChatProviders() []ChatProvider {
8283
}
8384

8485
if len(OpenAICompatibleAPIKey) > 0 && len(OpenAICompatibleEndpoint) > 0 {
85-
label := OpenAICompatibleLabel
86-
if label == "" {
87-
label = "OpenAI-Compatible API"
88-
}
8986
providers = append(providers, ChatProvider{
9087
Type: "OpenAI-Compatible",
9188
APIKey: OpenAICompatibleAPIKey,

frontend/src/components/icons.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,5 +194,8 @@ export const Icons = {
194194
<path d="M35.556 7.504h-3.764V43.05h3.764V7.504zm10.038 0h-3.764V43.05h3.764V7.504zM25.518 7.504h-3.764V43.05h3.764V7.504zm-10.038 0h-3.764V43.05h3.764V7.504zM5.442 7.504H1.678V43.05h3.764V7.504z" fill="#fff"/>
195195
</svg>,
196196
Anthropic: <svg className="w-6 h-6 bg-white" width="256px" height="176px" viewBox="0 0 256 176" version="1.1" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid"> <title>Anthropic</title> <g fill="#181818"> <path d="M147.486878,0 C147.486878,0 217.568251,175.780074 217.568251,175.780074 C217.568251,175.780074 256,175.780074 256,175.780074 C256,175.780074 185.918621,0 185.918621,0 C185.918621,0 147.486878,0 147.486878,0 C147.486878,0 147.486878,0 147.486878,0 Z"></path> <path d="M66.1828124,106.221191 C66.1828124,106.221191 90.1624677,44.4471185 90.1624677,44.4471185 C90.1624677,44.4471185 114.142128,106.221191 114.142128,106.221191 C114.142128,106.221191 66.1828124,106.221191 66.1828124,106.221191 C66.1828124,106.221191 66.1828124,106.221191 66.1828124,106.221191 Z M70.0705318,0 C70.0705318,0 0,175.780074 0,175.780074 C0,175.780074 39.179211,175.780074 39.179211,175.780074 C39.179211,175.780074 53.5097704,138.86606 53.5097704,138.86606 C53.5097704,138.86606 126.817544,138.86606 126.817544,138.86606 C126.817544,138.86606 141.145724,175.780074 141.145724,175.780074 C141.145724,175.780074 180.324935,175.780074 180.324935,175.780074 C180.324935,175.780074 110.254409,0 110.254409,0 C110.254409,0 70.0705318,0 70.0705318,0 C70.0705318,0 70.0705318,0 70.0705318,0 Z"></path> </g></svg>,
197+
OpenAICompatible: <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor" className="size-6">
198+
<path strokeLinecap="round" strokeLinejoin="round" d="M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z" />
199+
</svg>,
197200
},
198201
}

frontend/src/pages/chat/chat.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ export const ChatPage: FC = () => {
360360
return modelTypes.filter(modelType => modelType != null).map(modelType => ({
361361
id: modelType.id,
362362
label: modelType.modelType,
363-
icon: (Icons.Logos as Record<string, ReactElement>)[modelType.modelType],
363+
icon: (Icons.Logos as Record<string, ReactElement>)[modelType.modelType.replace("-", "")],
364364
extra: {
365365
token: modelType.token,
366366
}
@@ -426,7 +426,7 @@ export const ChatPage: FC = () => {
426426
<Dropdown className="w-[200px]" value={modelType && {
427427
id: modelType.id,
428428
label: modelType.modelType,
429-
icon: (Icons.Logos as Record<string, ReactElement>)[modelType.modelType],
429+
icon: (Icons.Logos as Record<string, ReactElement>)[modelType.modelType.replace("-", "")],
430430
}}
431431
dropdownContainerHeight="max-h-[400px]"
432432
items={modelTypesDropdownItems}

0 commit comments

Comments
 (0)