mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 15:10:12 +01:00
🐛 Unable to set up Azure OpenAI https://github.com/siyuan-note/siyuan/issues/10469
This commit is contained in:
parent
9f69d7dc4a
commit
77885a8cc0
10 changed files with 35 additions and 3 deletions
|
|
@ -75,8 +75,13 @@ func ChatGPT(msg string, contextMsgs []string, c *openai.Client, model string, m
|
|||
return
|
||||
}
|
||||
|
||||
func NewOpenAIClient(apiKey, apiProxy, apiBaseURL, apiUserAgent string) *openai.Client {
|
||||
func NewOpenAIClient(apiKey, apiProxy, apiBaseURL, apiUserAgent, apiVersion, apiProvider string) *openai.Client {
|
||||
config := openai.DefaultConfig(apiKey)
|
||||
if "Azure" == apiProvider {
|
||||
config = openai.DefaultAzureConfig(apiKey, apiBaseURL)
|
||||
config.APIVersion = apiVersion
|
||||
}
|
||||
|
||||
transport := &http.Transport{}
|
||||
if "" != apiProxy {
|
||||
proxyUrl, err := url.Parse(apiProxy)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue