Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:sparkles: New settings UI https://github.com/siyuan-note/siyuan/issues/17601

Daniel8ef266997885
diff --git a/kernel/api/setting.go b/kernel/api/setting.go
index cef698c891..bc6b7c49d2 100644
--- a/kernel/api/setting.go
+++ b/kernel/api/setting.go
@@ -202,9 +202,6 @@ func setAI(c *gin.Context) {
if nil == p {
continue
}
- if p.APIKey != "" {
- p.Enabled = true
- }
if 1 > p.RequestTimeout {
p.RequestTimeout = 30
}
@@ -212,9 +209,6 @@ func setAI(c *gin.Context) {
if nil == m {
continue
}
- if m.Name != "" {
- m.Enabled = true
- }
if 0 > m.MaxTokens {
m.MaxTokens = 0
}
diff --git a/kernel/conf/ai.go b/kernel/conf/ai.go
index d8749befba..8f284c4778 100644
--- a/kernel/conf/ai.go
+++ b/kernel/conf/ai.go
@@ -44,9 +44,9 @@ type Agent struct {
}
type Embedding struct {
- ID string `json:"id,omitempty"`
+ ID string `json:"id"`
DisplayName string `json:"displayName,omitempty"`
- Enabled bool `json:"enabled,omitempty"`
+ Enabled bool `json:"enabled"`
APIKey string `json:"apiKey"`
BaseURL string `json:"baseURL"`
Name string `json:"name"`
@@ -54,9 +54,9 @@ type Embedding struct {
}
type Provider struct {
- ID string `json:"id,omitempty"`
+ ID string `json:"id"`
DisplayName string `json:"displayName,omitempty"`
- Enabled bool `json:"enabled,omitempty"`
+ Enabled bool `json:"enabled"`
APIKey string `json:"apiKey"`
BaseURL string `json:"baseURL"`
RequestTimeout int `json:"requestTimeout"`
@@ -64,9 +64,9 @@ type Provider struct {
}
type Model struct {
- ID string `json:"id,omitempty"`
+ ID string `json:"id"`
DisplayName string `json:"displayName,omitempty"`
- Enabled bool `json:"enabled,omitempty"`
+ Enabled bool `json:"enabled"`
Name string `json:"name"`
MaxTokens int `json:"maxTokens"`
Temperature float64 `json:"temperature"`