application.yml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. spring:
  2. application:
  3. name: pharmacopoeia-ai
  4. datasource:
  5. url: jdbc:postgresql://localhost:5432/pharmacopoeia
  6. username: postgres
  7. password: pharma2025
  8. driver-class-name: org.postgresql.Driver
  9. jpa:
  10. hibernate:
  11. ddl-auto: none
  12. show-sql: false
  13. properties:
  14. hibernate:
  15. dialect: org.hibernate.dialect.PostgreSQLDialect
  16. format_sql: true
  17. data:
  18. redis:
  19. host: localhost
  20. port: 6379
  21. jackson:
  22. serialization:
  23. write-dates-as-timestamps: false
  24. servlet:
  25. multipart:
  26. max-file-size: 50MB
  27. max-request-size: 55MB
  28. server:
  29. port: 9000
  30. # ============================================
  31. # Qwen API 配置
  32. # ============================================
  33. qwen:
  34. api-key: ${QWEN_API_KEY:}
  35. base-url: https://dashscope.aliyuncs.com/compatible-mode/v1
  36. model: qwen3.7-max
  37. max-tokens: 4096
  38. temperature: 0.0
  39. # 视觉模型(图片分析+OCR)
  40. # 多模态模型(图片/视频分析,原生 API)
  41. vl-model: qwen3.7-plus
  42. multimodal-url: https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation
  43. enable-web-search: true
  44. # 嵌入模型
  45. embedding-model: text-embedding-v3
  46. embedding-url: https://dashscope.aliyuncs.com/api/v1/services/embeddings/text-embedding/text-embedding
  47. embedding-dim: 1024
  48. # ============================================
  49. # 鉴权
  50. # ============================================
  51. auth:
  52. enabled: true # 上线后改为 true
  53. admin-token: "" # 运营端管理 token(与 JWT 无关,单独配置)
  54. # ============================================
  55. # JWT
  56. # ============================================
  57. jwt:
  58. secret: YourSuperSecretKeyForJWTTokenGenerationMustBeAtLeast256BitsLong!!
  59. expiration: 86400000 # 24小时 (ms)
  60. # ============================================
  61. # 微信小程序
  62. # ============================================
  63. wechat:
  64. app-id: ${WECHAT_APPID:}
  65. secret: ${WECHAT_SECRET:}
  66. # ============================================
  67. # 百炼(DashScope)API 全局限流
  68. # 控制后端 → 百炼的总调用量,与用户侧限流独立
  69. # 最终是否限制、限制多少由客户确认后配置
  70. # ============================================
  71. dashscope:
  72. rate-limit:
  73. enabled: false # 客户确认后改为 true
  74. per-minute: 100
  75. per-hour: 2000
  76. per-day: 50000
  77. # ============================================
  78. # 限流
  79. # ============================================
  80. rate-limit:
  81. per-minute: 200 # 每 IP 每分钟最多 60 次 chat 请求
  82. per-hour: 999999 # 极大=不限
  83. per-day: 999999 # 极大=不限
  84. # ============================================
  85. # 倪海厦 RAG 配置
  86. # ============================================
  87. nihaisha:
  88. onnx:
  89. model-path: ${ONNX_MODEL_PATH:models}
  90. llm:
  91. primary:
  92. url: ${LLM_PRIMARY_URL:http://localhost:11434/v1}
  93. model: ${LLM_PRIMARY_MODEL:qwen2.5:14b}
  94. fallback:
  95. url: ${LLM_FALLBACK_URL:https://dashscope.aliyuncs.com/compatible-mode/v1}
  96. api-key: ${DASHSCOPE_API_KEY:}
  97. model: ${LLM_FALLBACK_MODEL:qwen-plus}
  98. timeout: 30s
  99. search:
  100. default-limit: 20
  101. max-limit: 100
  102. rrf-k: 60
  103. logging:
  104. level:
  105. com.pharmacopoeia: INFO
  106. org.springframework.web: WARN
  107. file:
  108. path: ${LOG_DIR:/var/log/pharmacopoeia}