mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🎨 Support custom AI request User-Agent header https://github.com/siyuan-note/siyuan/issues/10351
This commit is contained in:
parent
3df54adcc5
commit
7e87c8c8ad
11 changed files with 59 additions and 8 deletions
|
|
@ -405,15 +405,24 @@ func InitConf() {
|
|||
if "" == Conf.AI.OpenAI.APIModel {
|
||||
Conf.AI.OpenAI.APIModel = openai.GPT3Dot5Turbo
|
||||
}
|
||||
if "" == Conf.AI.OpenAI.APIUserAgent {
|
||||
Conf.AI.OpenAI.APIUserAgent = util.UserAgent
|
||||
}
|
||||
|
||||
if "" != Conf.AI.OpenAI.APIKey {
|
||||
logging.LogInfof("OpenAI API enabled\n"+
|
||||
" userAgent=%s\n"+
|
||||
" baseURL=%s\n"+
|
||||
" timeout=%ds\n"+
|
||||
" proxy=%s\n"+
|
||||
" model=%s\n"+
|
||||
" maxTokens=%d",
|
||||
Conf.AI.OpenAI.APIBaseURL, Conf.AI.OpenAI.APITimeout, Conf.AI.OpenAI.APIProxy, Conf.AI.OpenAI.APIModel, Conf.AI.OpenAI.APIMaxTokens)
|
||||
Conf.AI.OpenAI.APIUserAgent,
|
||||
Conf.AI.OpenAI.APIBaseURL,
|
||||
Conf.AI.OpenAI.APITimeout,
|
||||
Conf.AI.OpenAI.APIProxy,
|
||||
Conf.AI.OpenAI.APIModel,
|
||||
Conf.AI.OpenAI.APIMaxTokens)
|
||||
}
|
||||
|
||||
Conf.ReadOnly = util.ReadOnly
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue