Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zmh-program committed Oct 24, 2023
1 parent f9949a8 commit db711fb
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions adapter/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"chat/adapter/zhipuai"
"chat/globals"
"chat/utils"
"github.com/spf13/viper"
)

type ChatProps struct {
Expand All @@ -28,15 +27,11 @@ func NewChatRequest(props *ChatProps, hook globals.Hook) error {
Reversible: props.Reversible,
})
return instance.CreateStreamChatRequest(&chatgpt.ChatProps{
Model: utils.Multi(
props.Reversible && globals.IsGPT4NativeModel(props.Model),
viper.GetString("openai.reverse.hash"),
props.Model,
),
Model: props.Model,
Message: props.Message,
Token: utils.Multi(
props.Token == 0,
utils.Multi(globals.IsGPT4Model(props.Model) || props.Reversible || props.Infinity, -1, 2000),
utils.Multi(globals.IsGPT4Model(props.Model) || props.Infinity, -1, 2000),
props.Token,
),
}, hook)
Expand Down

0 comments on commit db711fb

Please sign in to comment.