mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-07 08:01:47 +01:00
🎨 OpenAI API 接入增加环境变量 SIYUAN_OPENAI_API_BASE_URL
This commit is contained in:
parent
1c9e0356cc
commit
a8129de5f5
2 changed files with 18 additions and 11 deletions
|
|
@ -27,26 +27,20 @@ import (
|
|||
)
|
||||
|
||||
func ChatGPT(msg string) (ret string) {
|
||||
cloud := IsSubscriber()
|
||||
if !cloud && !isOpenAIAPIEnabled() {
|
||||
if !isOpenAIAPIEnabled() {
|
||||
return
|
||||
}
|
||||
|
||||
cloud = false
|
||||
|
||||
return chatGPT(msg, cloud)
|
||||
return chatGPT(msg, false)
|
||||
}
|
||||
|
||||
func ChatGPTWithAction(ids []string, action string) (ret string) {
|
||||
cloud := IsSubscriber()
|
||||
if !cloud && !isOpenAIAPIEnabled() {
|
||||
if !isOpenAIAPIEnabled() {
|
||||
return
|
||||
}
|
||||
|
||||
cloud = false
|
||||
|
||||
msg := getBlocksContent(ids)
|
||||
ret = chatGPTWithAction(msg, action, cloud)
|
||||
ret = chatGPTWithAction(msg, action, false)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue