redis缓存替换+pgvector向量替换

This commit is contained in:
1iaan
2026-04-04 22:39:16 +08:00
parent e993eb6c5c
commit 9d7c416737
124 changed files with 5460 additions and 141 deletions

View File

@@ -53,7 +53,37 @@ dependOn:
address: "localhost:50054"
accessToken: "ang1chubdev1ozhome256487d22sapguuv1ozhom"
tokenizer:
address: "http://192.168.239.161:3002"
address: "http://127.0.0.1:3002"
vector:
# 向量后端tencent / pgvector
provider: "pgvector"
# 历史问答命中阈值
threshold: 0.99
tencent:
url: "http://lb-4u4r1fk4-1ys6gv3rpmdan420.clb.ap-guangzhou.tencentclb.com:60000"
username: "root"
pwd: "YaUfVueWZJ20e4ghyLlBT8Dou5OapwpFTUq50oft"
database: "ai-chat"
timeout: 5
maxIdleConnPerHost: 2
readConsistency: "eventualConsistency"
idleConnTimeout: 60
pgvector:
dsn: "postgres://postgres:postgres@127.0.0.1:15432/ai_chat?sslmode=disable"
table: "chat_record_vectors"
dimensions: 1024
maxLifeTime: 3600
maxOpenConn: 10
maxIdleConn: 10
embedding:
provider: "openai-compatible"
# 智谱 OpenAI 兼容网关;可被项目根目录 .env 覆盖
base_url: "https://open.bigmodel.cn/api/paas/v4"
# 默认故意设成错误值,真实 key 请放到项目根目录 .env
api_key: "__INVALID_SET_AI_CHAT_EMBEDDING_API_KEY__"
# embedding-2 固定 1024 维,和当前 pgvector 表结构一致
model: "embedding-2"
timeout: 10
vectorDB:
# 访问地址
url: "http://lb-4u4r1fk4-1ys6gv3rpmdan420.clb.ap-guangzhou.tencentclb.com:60000"
@@ -69,4 +99,4 @@ vectorDB:
# 读一致性: strongConsistency(强一致性)eventualConsistency(最终一致性)
readConsistency: "eventualConsistency"
# 空闲连接超时时长s
idleConnTimeout: 60
idleConnTimeout: 60