写成屎山了

This commit is contained in:
2026-06-18 08:35:09 +08:00
parent 45822fd333
commit fcd230cb5b
7 changed files with 186 additions and 44 deletions
+12
View File
@@ -170,6 +170,18 @@ func (s *store) GetLLMPrimaryConfigSystemPrompt() (string, error) {
return record.SystemPrompt, nil
}
// GetLLMPrimaryConfigEnableTool 获取是否启用工具调用
func (s *store) GetLLMPrimaryConfigEnableTool() (bool, error) {
record, err := s.GetLLMPrimaryConfig()
if err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
return false, nil
}
return false, err
}
return record.EnableTool, nil
}
// CreateLLMPrimaryConfig 创建主 AI 回复配置
func (s *store) CreateLLMPrimaryConfig(record *llmPrimaryConfigRecord) error {
if err := s.db.Create(record).Error; err != nil {