Skip to content

Commit

Permalink
add model market feature
Browse files Browse the repository at this point in the history
  • Loading branch information
zmh-program committed Nov 15, 2023
1 parent c31a1c9 commit 76b91c5
Show file tree
Hide file tree
Showing 42 changed files with 1,009 additions and 115 deletions.
2 changes: 1 addition & 1 deletion adapter/oneapi/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type AdapterProps struct {
}

func HandleRequest(props *AdapterProps, hook globals.Hook) error {
instance := NewChatInstanceFromConfig(props.Model)
instance := NewChatInstanceFromConfig()
return instance.CreateStreamChatRequest(&ChatProps{
Model: instance.FormatModel(props.Model),
Message: instance.FormatMessage(props.Message),
Expand Down
10 changes: 1 addition & 9 deletions adapter/oneapi/struct.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package oneapi

import (
"chat/globals"
"chat/utils"
"fmt"
"github.com/spf13/viper"
Expand Down Expand Up @@ -39,14 +38,7 @@ func NewChatInstance(endpoint, apiKey string) *ChatInstance {
}
}

func NewChatInstanceFromConfig(model string) *ChatInstance {
if model == globals.Claude2100k {
return NewChatInstance(
viper.GetString("oneapi.claude.endpoint"),
viper.GetString("oneapi.claude.apikey"),
)
}

func NewChatInstanceFromConfig() *ChatInstance {
return NewChatInstance(
viper.GetString("oneapi.endpoint"),
viper.GetString("oneapi.apikey"),
Expand Down
1 change: 1 addition & 0 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"react-router-dom": "^6.17.0",
"react-syntax-highlighter": "^15.5.0",
"rehype-katex": "^6.0.3",
"remark-breaks": "^4.0.0",
"remark-gfm": "^3.0.1",
"remark-math": "^5.1.1",
"sort-by": "^1.2.0",
Expand Down
89 changes: 89 additions & 0 deletions app/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added app/public/icons/chatglm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/icons/claude.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/icons/claude100k.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/icons/dalle.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/icons/gpt35turbo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/icons/gpt35turbo16k.webp
Binary file not shown.
Binary file added app/public/icons/gpt4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/icons/gpt432k.webp
Binary file not shown.
Binary file added app/public/icons/gpt4dalle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/icons/gpt4v.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/icons/hunyuan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/icons/llama2.webp
Binary file not shown.
Binary file added app/public/icons/llamacode.webp
Binary file not shown.
Binary file added app/public/icons/midjourney.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/icons/newbing.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/icons/palm2.webp
Binary file not shown.
Binary file added app/public/icons/sparkdesk.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/icons/stablediffusion.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/icons/tongyi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions app/src/assets/globals.less
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
--chat-bot-background: rgba(88, 166, 255, .04);
--chat-bot-border: rgba(88, 166, 255, .12);
--chat-bot-border-hover: rgba(88, 166, 255, .24);

--model-card-background: rgba(222,214,200,.2);
}

.dark {
Expand Down Expand Up @@ -97,6 +99,8 @@
--chat-bot-background: rgba(88, 166, 255, .1);
--chat-bot-border: rgba(88, 166, 255, .2);
--chat-bot-border-hover: rgba(88, 166, 255, .25);

--model-card-background: rgba(152,153,165,.05);
}
}

Expand Down
Loading

0 comments on commit 76b91c5

Please sign in to comment.