update:1.切换数据库PostgreSQL

This commit is contained in:
xiamuceer
2025-11-10 21:16:55 +08:00
parent dfea51cfa4
commit 20d9319a16
31 changed files with 2526 additions and 256 deletions
+6 -2
View File
@@ -82,7 +82,9 @@ class AIService:
self.openai_http_client = None
self.openai_api_key = None
self.openai_base_url = None
logger.warning("OpenAI API key未配置")
# 只有当用户明确选择OpenAI作为提供商时才警告
if self.api_provider == "openai":
logger.warning("⚠️ OpenAI API key未配置,但被设置为当前AI提供商")
# 初始化Anthropic客户端
anthropic_key = api_key if api_provider == "anthropic" else app_settings.anthropic_api_key
@@ -118,7 +120,9 @@ class AIService:
self.anthropic_client = None
else:
self.anthropic_client = None
logger.warning("Anthropic API key未配置")
# 只有当用户明确选择Anthropic作为提供商时才警告
if self.api_provider == "anthropic":
logger.warning("⚠️ Anthropic API key未配置,但被设置为当前AI提供商")
async def generate_text(
self,
+1 -1
View File
@@ -87,7 +87,7 @@ class MemoryService:
'sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2',
cache_folder=model_cache_dir,
device='cpu', # 明确指定使用CPU
trust_remote_code=False # 安全起见
trust_remote_code=False, # 安全起见
)
logger.info("✅ Embedding模型加载成功 (paraphrase-multilingual-MiniLM-L12-v2)")
except Exception as e: