mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 03:19:18 +08:00
feat: 新增agent
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
-- ========================================
|
||||
-- Agent:公司模型 API 配置(OpenAI Compatible)
|
||||
-- 表 agent_company_llm_settings
|
||||
-- 迁移:V20260919c__agent_company_llm_settings.sql
|
||||
-- ========================================
|
||||
-- 约定:
|
||||
-- 1) 按 company_id 一行;api_key 加密存储,接口只回掩码
|
||||
-- 2) Agent 进程经内部接口取运行时明文,Redis 缓存 agent:llm:rt:{companyId}
|
||||
-- 3) 与聊天会话 Mongo 分离:凭证归业务库(MySQL),对话归 Agent Mongo
|
||||
-- ========================================
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `agent_company_llm_settings` (
|
||||
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`company_id` bigint UNSIGNED NOT NULL COMMENT '公司ID',
|
||||
`base_url` varchar(500) NOT NULL COMMENT 'OpenAI Compatible Base URL',
|
||||
`api_key_encrypted` varchar(2000) NOT NULL COMMENT 'API Key 密文',
|
||||
`api_key_suffix` varchar(16) NOT NULL DEFAULT '' COMMENT 'Key 末几位(展示掩码)',
|
||||
`model` varchar(200) NOT NULL COMMENT '默认模型名',
|
||||
`extra_headers_json` json NULL COMMENT '可选额外请求头',
|
||||
`create_by` bigint UNSIGNED NULL COMMENT '创建人用户ID',
|
||||
`update_by` bigint UNSIGNED NULL COMMENT '更新人用户ID',
|
||||
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_agent_llm_company` (`company_id`),
|
||||
CONSTRAINT `fk_agent_llm_company` FOREIGN KEY (`company_id`) REFERENCES `org_company` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='公司 Agent 模型 API 配置';
|
||||
Reference in New Issue
Block a user