service 修改 Redis 存储 KV
This commit is contained in:
@@ -1,35 +1,4 @@
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:8.0
|
||||
container_name: ai-chat-mysql
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: root
|
||||
command:
|
||||
- --default-authentication-plugin=mysql_native_password
|
||||
volumes:
|
||||
- /data/mysql:/var/lib/mysql
|
||||
- /home/lian/share/aichat/init/create_db.sql:/docker-entrypoint-initdb.d/create_db.sql:ro
|
||||
healthcheck:
|
||||
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "-proot"]
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
|
||||
pgvector:
|
||||
image: pgvector/pgvector:pg16
|
||||
container_name: ai-chat-pgvector
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_DB: ai_chat
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
ports:
|
||||
- "15432:5432"
|
||||
volumes:
|
||||
- /data/pgvector:/var/lib/postgresql/data
|
||||
- /home/lian/share/aichat/init/pgvector-init.sql:/docker-entrypoint-initdb.d/pgvector-init.sql:ro
|
||||
|
||||
tokenizer:
|
||||
build:
|
||||
context: ../tokenizer
|
||||
@@ -83,11 +52,9 @@ services:
|
||||
ports:
|
||||
- "50055:50055"
|
||||
depends_on:
|
||||
- mysql
|
||||
- tokenizer
|
||||
- sensitive-filter
|
||||
- keywords-filter
|
||||
- pgvector
|
||||
healthcheck:
|
||||
test: ["CMD", "grpc_health_probe", "-addr=:50055"]
|
||||
interval: 15s
|
||||
|
||||
@@ -16,17 +16,10 @@ chat:
|
||||
frequency_penalty: 0
|
||||
bot_desc: "你是一个AI助手,我需要你模拟一名资深的软件工程师来回答我的问题"
|
||||
min_response_tokens: 600
|
||||
context_ttl: 1800
|
||||
context_len: 4
|
||||
redis:
|
||||
host: "host.docker.internal"
|
||||
port: 8888
|
||||
pwd: "123456"
|
||||
mysql:
|
||||
dsn: "root:root@tcp(mysql:3306)/ai_chat?collation=utf8mb4_unicode_ci&charset=utf8mb4"
|
||||
maxLifeTime: 3600
|
||||
maxOpenConn: 10
|
||||
maxIdleConn: 10
|
||||
dependOn:
|
||||
sensitive:
|
||||
address: "sensitive-filter:50053"
|
||||
@@ -36,19 +29,14 @@ dependOn:
|
||||
accessToken: "ang1chubdev1ozhome256487d22sapguuv1ozhom"
|
||||
tokenizer:
|
||||
address: "http://tokenizer:3002"
|
||||
vector:
|
||||
provider: "pgvector"
|
||||
threshold: 0.99
|
||||
pgvector:
|
||||
dsn: "postgres://postgres:postgres@pgvector:5432/ai_chat?sslmode=disable"
|
||||
table: "chat_record_vectors"
|
||||
dimensions: 1024
|
||||
maxLifeTime: 3600
|
||||
maxOpenConn: 10
|
||||
maxIdleConn: 10
|
||||
embedding:
|
||||
provider: "openai-compatible"
|
||||
base_url: "https://open.bigmodel.cn/api/paas/v4"
|
||||
api_key: "__SET_FROM_ENV__"
|
||||
model: "embedding-2"
|
||||
timeout: 10
|
||||
faiss:
|
||||
base_url: "http://host.docker.internal:8451"
|
||||
search_k: 1
|
||||
similarity_threshold: 0.9
|
||||
timeout: 10
|
||||
|
||||
Reference in New Issue
Block a user