mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
🎨 Allow GPT Model selection in UI https://github.com/siyuan-note/siyuan/issues/8142
This commit is contained in:
parent
f6f3ebbcb2
commit
7daafcb3af
13 changed files with 63 additions and 19 deletions
|
|
@ -22,7 +22,7 @@ import (
|
|||
|
||||
"github.com/88250/lute/ast"
|
||||
"github.com/88250/lute/parse"
|
||||
gogpt "github.com/sashabaranov/go-gpt3"
|
||||
"github.com/sashabaranov/go-openai"
|
||||
"github.com/siyuan-note/siyuan/kernel/treenode"
|
||||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
|
@ -154,11 +154,11 @@ type GPT interface {
|
|||
}
|
||||
|
||||
type OpenAIGPT struct {
|
||||
c *gogpt.Client
|
||||
c *openai.Client
|
||||
}
|
||||
|
||||
func (gpt *OpenAIGPT) chat(msg string, contextMsgs []string) (partRet string, stop bool, err error) {
|
||||
return util.ChatGPT(msg, contextMsgs, gpt.c, Conf.AI.OpenAI.APIMaxTokens, Conf.AI.OpenAI.APITimeout)
|
||||
return util.ChatGPT(msg, contextMsgs, gpt.c, Conf.AI.OpenAI.APIModel, Conf.AI.OpenAI.APIMaxTokens, Conf.AI.OpenAI.APITimeout)
|
||||
}
|
||||
|
||||
type CloudGPT struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue