209 lines
5.8 KiB
YAML
209 lines
5.8 KiB
YAML
server:
|
||
port: 9900
|
||
servlet:
|
||
encoding:
|
||
charset: UTF-8
|
||
enabled: true
|
||
force: true
|
||
|
||
file:
|
||
upload:
|
||
path: ./uploads
|
||
allowed-extensions: txt,md
|
||
|
||
# 知识库配置
|
||
knowledge:
|
||
base-path: knowledge_base/
|
||
|
||
milvus:
|
||
host: in03-4a578da0f27ce9d.serverless.aws-eu-central-1.cloud.zilliz.com
|
||
port: 443
|
||
username: ""
|
||
password: ""
|
||
database: db_4a578da0f27ce9d
|
||
timeout: 10000
|
||
token: ${MILVUS_TOKEN}
|
||
secure: true
|
||
vector-dim: 1024 # BGE-M3 = 1024,换模型时同步改
|
||
|
||
# =====================================================
|
||
# 模型路由配置
|
||
# =====================================================
|
||
# 通过关键字匹配 Bean,切换模型只改这里 + 对应 api-key
|
||
# Chat: deepseek | openai | ollama | ...
|
||
# Embedding: siliconflow | openai | ollama | dashscope | ...
|
||
# =====================================================
|
||
|
||
model-routing:
|
||
chat: deepseek
|
||
embedding: siliconflow
|
||
|
||
spring:
|
||
# =====================================================
|
||
# 数据源配置 (MySQL)
|
||
# =====================================================
|
||
datasource:
|
||
url: jdbc:mysql://119.29.78.52:33306/superbiz_agent?useUnicode=true&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||
username: root
|
||
password: ${SUPERBIZ_MYSQL_PASSWORD}
|
||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||
hikari:
|
||
maximum-pool-size: 5
|
||
minimum-idle: 1
|
||
connection-timeout: 10000
|
||
validation-timeout: 5000
|
||
idle-timeout: 60000
|
||
max-lifetime: 120000
|
||
keepalive-time: 30000
|
||
|
||
# =====================================================
|
||
# JPA 配置
|
||
# =====================================================
|
||
jpa:
|
||
hibernate:
|
||
ddl-auto: validate # Flyway 管理表结构,这里使用 validate
|
||
show-sql: true
|
||
properties:
|
||
hibernate:
|
||
format_sql: true
|
||
dialect: org.hibernate.dialect.MySQL8Dialect
|
||
|
||
# =====================================================
|
||
# Flyway 数据库迁移配置
|
||
# =====================================================
|
||
flyway:
|
||
enabled: true
|
||
baseline-on-migrate: true
|
||
locations: classpath:db/migration
|
||
|
||
# =====================================================
|
||
# Redis 配置
|
||
# =====================================================
|
||
data:
|
||
redis:
|
||
host: 119.29.78.52
|
||
port: 33308
|
||
password: ${SUPERBIZ_REDIS_PASSWORD}
|
||
database: 0
|
||
timeout: 3000
|
||
lettuce:
|
||
pool:
|
||
max-active: 8
|
||
max-idle: 8
|
||
min-idle: 0
|
||
|
||
ai:
|
||
# Harness owns allowed retries; provider SDK calls execute once per recorded attempt.
|
||
retry:
|
||
max-attempts: 1
|
||
|
||
vectorstore:
|
||
type: milvus
|
||
milvus:
|
||
initialize-schema: false
|
||
database-name: ${milvus.database}
|
||
collection-name: biz
|
||
embedding-dimension: ${milvus.vector-dim}
|
||
index-type: IVF_FLAT
|
||
metric-type: L2
|
||
index-parameters: '{"nlist":128}'
|
||
id-field-name: id
|
||
auto-id: false
|
||
content-field-name: content
|
||
metadata-field-name: metadata
|
||
embedding-field-name: vector
|
||
client:
|
||
host: ${milvus.host}
|
||
port: ${milvus.port}
|
||
token: ${milvus.token}
|
||
username: ${milvus.username}
|
||
password: ${milvus.password}
|
||
secure: ${milvus.secure}
|
||
connect-timeout-ms: ${milvus.timeout}
|
||
|
||
# --- Chat: DeepSeek (原生) ---
|
||
deepseek:
|
||
api-key: ${DEEPSEEK_API_KEY}
|
||
base-url: https://api.deepseek.com
|
||
chat:
|
||
options:
|
||
model: deepseek-v4-flash
|
||
|
||
# --- OpenAI 模块供 SiliconFlow Embedding 复用 ---
|
||
openai:
|
||
api-key: unused
|
||
|
||
# Spring AI MCP 客户端配置
|
||
mcp:
|
||
client:
|
||
enabled: false
|
||
|
||
# --- Embedding: SiliconFlow BGE-M3 ---
|
||
siliconflow:
|
||
api-key: ${SILICONFLOW_API_KEY}
|
||
base-url: https://api.siliconflow.cn
|
||
embedding:
|
||
model: BAAI/bge-m3
|
||
|
||
# 文档分片配置
|
||
document:
|
||
chunk:
|
||
max-size: 800
|
||
overlap: 100
|
||
|
||
# RAG 配置
|
||
rag:
|
||
top-k: 3 # 检索返回的最相似文档数量
|
||
sidecar:
|
||
spring-ai:
|
||
enabled: false
|
||
content-preview-limit: 300
|
||
|
||
# 检索归一化配置
|
||
retrieval:
|
||
kb-scope: "" # empty means search all legacy documents; use rag-eval for eval seed docs
|
||
vector-store:
|
||
mode: auto # auto | spring-ai | sdk
|
||
normalization:
|
||
max-l2-distance: 2.0 # L2 距离上界(BGE-M3 单位向量 = 2.0)
|
||
highly-relevant-threshold: 0.75 # similarity >= 0.75 → HIGHLY_RELEVANT
|
||
reference-threshold: 0.5 # similarity >= 0.5 → REFERENCE
|
||
|
||
# Prometheus 配置
|
||
prometheus:
|
||
base-url: http://localhost:9090
|
||
timeout: 10 # 超时时间(秒)
|
||
mock-enabled: true # 是否启用 Mock 模式(用于测试)
|
||
|
||
# CLS 云日志服务配置
|
||
cls:
|
||
mock-enabled: true # 是否启用 Mock 模式(用于测试,设为 true 返回与告警关联的模拟日志数据)
|
||
|
||
# =====================================================
|
||
# 日志配置
|
||
# =====================================================
|
||
logging:
|
||
file:
|
||
name: logs/application.log # 日志文件路径
|
||
pattern:
|
||
console: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"
|
||
file: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"
|
||
level:
|
||
root: INFO
|
||
com.superbiz.agent: DEBUG # 本项目包日志级别设为 DEBUG
|
||
org.springframework.ai: DEBUG # Spring AI 日志
|
||
org.springframework.data: INFO # Spring Data 日志
|
||
org.hibernate: INFO # Hibernate 日志
|
||
com.alibaba.cloud: INFO
|
||
logback:
|
||
rollingpolicy:
|
||
max-file-size: 10MB # 单个日志文件最大 10MB
|
||
max-history: 30 # 保留 30 天
|
||
total-size-cap: 1GB # 所有日志文件总大小上限 1GB
|
||
|
||
# Agent-facing MySQL Tool uses independent logical datasources only.
|
||
# Production entries are supplied by a dedicated profile and Secret injection.
|
||
harness:
|
||
mysql-tools:
|
||
data-sources: {}
|