* [story#80584] rename prompt to agent
This commit is contained in:
@@ -628,9 +628,9 @@ define('TABLE_SPACE', '`' . $config->db->prefix . 'space`');
|
||||
define('TABLE_INSTANCE', '`' . $config->db->prefix . 'instance`');
|
||||
define('TABLE_ARTIFACTREPO', '`' . $config->db->prefix . 'artifactrepo`');
|
||||
|
||||
define('TABLE_AI_PROMPT', '`' . $config->db->prefix . 'ai_prompt`');
|
||||
define('TABLE_AI_PROMPTFIELD', '`' . $config->db->prefix . 'ai_promptfield`');
|
||||
define('TABLE_AI_PROMPTROLE', '`' . $config->db->prefix . 'ai_promptrole`');
|
||||
define('TABLE_AI_AGENT', '`' . $config->db->prefix . 'ai_agent`');
|
||||
define('TABLE_AI_AGENTFIELD', '`' . $config->db->prefix . 'ai_agentfield`');
|
||||
define('TABLE_AI_AGENTROLE', '`' . $config->db->prefix . 'ai_agentrole`');
|
||||
define('TABLE_AI_MINIPROGRAM', '`' . $config->db->prefix . 'ai_miniprogram`');
|
||||
define('TABLE_AI_MINIPROGRAMFIELD', '`' . $config->db->prefix . 'ai_miniprogramfield`');
|
||||
define('TABLE_AI_MINIPROGRAMSTAR', '`' . $config->db->prefix . 'ai_miniprogramstar`');
|
||||
@@ -734,7 +734,7 @@ $config->objectTables['lang'] = TABLE_LANG;
|
||||
$config->objectTables['review'] = TABLE_REVIEW;
|
||||
$config->objectTables['effort'] = TABLE_EFFORT;
|
||||
$config->objectTables['design'] = TABLE_DESIGN;
|
||||
$config->objectTables['prompt'] = TABLE_AI_PROMPT;
|
||||
$config->objectTables['prompt'] = TABLE_AI_AGENT;
|
||||
$config->objectTables['aiapp'] = TABLE_AI_MINIPROGRAM;
|
||||
$config->objectTables['miniprogram'] = TABLE_AI_MINIPROGRAM;
|
||||
$config->objectTables['roadmap'] = TABLE_ROADMAP;
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
RENAME TABLE `zt_ai_prompt` TO `zt_ai_agent`;
|
||||
RENAME TABLE `zt_ai_promptrole` TO `zt_ai_agentrole`;
|
||||
RENAME TABLE `zt_ai_promptfield` TO `zt_ai_agentfield`;
|
||||
+10
-10
@@ -15286,8 +15286,8 @@ CREATE TABLE IF NOT EXISTS `zt_ai_model` (
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- DROP TABLE IF EXISTS `zt_ai_prompt`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_ai_prompt` (
|
||||
-- DROP TABLE IF EXISTS `zt_ai_agent`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_ai_agent` (
|
||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(20) NOT NULL DEFAULT '',
|
||||
`desc` text DEFAULT NULL,
|
||||
@@ -15309,7 +15309,7 @@ CREATE TABLE IF NOT EXISTS `zt_ai_prompt` (
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
INSERT INTO `zt_ai_prompt` (`id`, `name`, `desc`, `model`, `module`, `source`, `targetForm`, `purpose`, `elaboration`, `role`, `characterization`, `createdBy`, `createdDate`, `status`) VALUES
|
||||
INSERT INTO `zt_ai_agent` (`id`, `name`, `desc`, `model`, `module`, `source`, `targetForm`, `purpose`, `elaboration`, `role`, `characterization`, `createdBy`, `createdDate`, `status`) VALUES
|
||||
(1, '需求润色', '优化需求中标题、描述和验收标准等字段,使表述清晰准确。', 0, 'story', ',story.title,story.spec,story.verify,story.product,story.module,story.pri,story.category,story.estimate,', 'story.change', '帮忙优化其中各字段的表述,使表述清晰准确。必要时可以修改需求使其更加合理。', '需求描述格式建议使用:作为一名<某种类型的用户>,我希望<达成某些目的>,这样可以<开发的价值>。验收标准建议列举多条。直接给出你的润色结果,无需建议。', '请你扮演一名资深的产品经理。', '负责产品战略、设计、开发、数据分析、用户体验、团队管理、沟通协调等方面,需要具备多种技能和能力,以实现产品目标和公司战略。', 'system', '2023-08-10 13:24:14', 'active'),
|
||||
(2, '一键拆用例', '为需求生成一个或多个对应的测试用例。', 0, 'story', ',story.title,story.spec,story.verify,story.product,story.module,story.pri,story.category,story.estimate,', 'story.testcasecreate', '为这个需求生成一个或多个对应的测试用例。', '', '作为一名资深的测试工程师。', '熟悉测试流程和方法,精通自动化测试和性能测试,能够设计和编写测试用例和测试脚本,擅长问题诊断和分析,熟悉敏捷开发和持续集成,能够协调多部门合作和项目管理。开发工程师应该是专业且严谨的。', 'system', '2023-08-10 13:24:14', 'active'),
|
||||
(3, '任务润色', '优化任务中标题、描述等字段的表述,使任务表述更清晰准确。', 0, 'task', ',task.name,task.desc,task.pri,task.status,task.estimate,task.consumed,task.left,task.progress,task.estStarted,task.realStarted,', 'task.edit', '优化其中各字段的表述,使表述清晰准确,明确任务目标。', '必要时指出任务的风险点。', '你是一名经验丰富的开发工程师。', '精通多种编程语言和框架、熟悉前后端技术和架构、擅长性能优化和安全防护、熟悉云计算和容器化技术、能够协调多人协作和项目管理。', 'system', '2023-08-10 13:24:14', 'active'),
|
||||
@@ -15328,10 +15328,10 @@ INSERT INTO `zt_ai_prompt` (`id`, `name`, `desc`, `model`, `module`, `source`, `
|
||||
5. 请生成完整的 HTML5 页面代码,包括开始的 `<!DOCTYPE html>` 和 结束的 `</html>`,使用 markdown html 代码块表示,如果有多个页面请使用多个代码块表示。
|
||||
6. 如果页面有 CSS,应该直接在 HTML 页面内使用内联样式`<style>`表示,而不是链接单独的 CSS 文件。', '', '请你扮演一名资深的产品经理。', '负责绘制需求原型图的过程。您将需求转化为可视化的原型图,同时确保其符合需求描述和需求验收标准。', 'system', '2025-11-30 12:00:00', 'active');
|
||||
|
||||
-- DROP TABLE IF EXISTS `zt_ai_promptfield`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_ai_promptfield` (
|
||||
-- DROP TABLE IF EXISTS `zt_ai_agentfield`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_ai_agentfield` (
|
||||
`id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
|
||||
`appID` int unsigned NOT NULL COMMENT '所属 Prompt 的 ID,对应 zt_ai_prompt.id',
|
||||
`appID` int unsigned NOT NULL COMMENT '所属 Prompt 的 ID,对应 zt_ai_agent.id',
|
||||
`name` varchar(30) NOT NULL DEFAULT '' COMMENT '字段名称',
|
||||
`type` varchar(20) NOT NULL DEFAULT 'text' COMMENT '字段类型',
|
||||
`placeholder` text DEFAULT NULL COMMENT '输入提示',
|
||||
@@ -15340,14 +15340,14 @@ CREATE TABLE IF NOT EXISTS `zt_ai_promptfield` (
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
INSERT INTO `zt_ai_promptfield` (`appID`, `name`, `type`, `placeholder`, `options`, `required`) VALUES
|
||||
INSERT INTO `zt_ai_agentfield` (`appID`, `name`, `type`, `placeholder`, `options`, `required`) VALUES
|
||||
(10, '设计类型', 'radio', '', '系统设计,架构设计,接口设计,数据库设计', 0),
|
||||
(10, '后端框架', 'radio', '', 'PHP,Go,Java,Python,Node.js,其他', 0),
|
||||
(10, '前端框架', 'radio', '', 'JavaScript,Vue,React,Angular,其他', 0),
|
||||
(10, '数据库类型', 'radio', '', 'MySQL,PostgreSQL,Oracle Database,Microsoft SQL Server,非关系型数据库', 0);
|
||||
|
||||
-- DROP TABLE IF EXISTS `zt_ai_promptrole`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_ai_promptrole` (
|
||||
-- DROP TABLE IF EXISTS `zt_ai_agentrole`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_ai_agentrole` (
|
||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(30) NOT NULL DEFAULT '',
|
||||
`desc` text DEFAULT NULL,
|
||||
@@ -15358,7 +15358,7 @@ CREATE TABLE IF NOT EXISTS `zt_ai_promptrole` (
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
INSERT INTO `zt_ai_promptrole` (`role`, `characterization`) VALUES
|
||||
INSERT INTO `zt_ai_agentrole` (`role`, `characterization`) VALUES
|
||||
('请你扮演一名资深的产品经理。', '负责产品战略、设计、开发、数据分析、用户体验、团队管理、沟通协调等方面,需要具备多种技能和能力,以实现产品目标和公司战略。'),
|
||||
('你是一名经验丰富的开发工程师。', '精通多种编程语言和框架、熟悉前后端技术和架构、擅长性能优化和安全防护、熟悉云计算和容器化技术、能够协调多人协作和项目管理。'),
|
||||
('作为一名资深的测试工程师。', '测试工程师应该是专业且严谨的。熟悉测试流程和方法,精通自动化测试和性能测试,能够设计和编写测试用例和测试脚本,擅长问题诊断和分析,熟悉敏捷开发和持续集成,能够协调多部门合作和项目管理。'),
|
||||
|
||||
+13
-13
@@ -1592,7 +1592,7 @@ class aiModel extends model
|
||||
*/
|
||||
public function getPrompts($module = '', $status = '', $order = 'id_desc', $pager = null)
|
||||
{
|
||||
$prompts = $this->dao->select('*')->from(TABLE_AI_PROMPT)
|
||||
$prompts = $this->dao->select('*')->from(TABLE_AI_AGENT)
|
||||
->where('deleted')->eq(0)
|
||||
->beginIF(!empty($module))->andWhere('module')->eq($module)->fi()
|
||||
->beginIF(!empty($status))->andWhere('status')->eq($status)->fi()
|
||||
@@ -1612,7 +1612,7 @@ class aiModel extends model
|
||||
*/
|
||||
public function getPromptById($id)
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_AI_PROMPT)
|
||||
return $this->dao->select('*')->from(TABLE_AI_AGENT)
|
||||
->where('id')->eq($id)
|
||||
->fetch();
|
||||
}
|
||||
@@ -1627,7 +1627,7 @@ class aiModel extends model
|
||||
public function getPromptFields(int $promptID): array
|
||||
{
|
||||
return $this->dao->select('*')
|
||||
->from(TABLE_AI_PROMPTFIELD)
|
||||
->from(TABLE_AI_AGENTFIELD)
|
||||
->where('appID')->eq($promptID)
|
||||
->fetchAll('id', false);
|
||||
}
|
||||
@@ -1647,7 +1647,7 @@ class aiModel extends model
|
||||
/* Override uniqueness error message. */
|
||||
$this->lang->error->unique = $this->lang->ai->validate->nameNotUnique;
|
||||
|
||||
$this->dao->insert(TABLE_AI_PROMPT)
|
||||
$this->dao->insert(TABLE_AI_AGENT)
|
||||
->data($prompt)
|
||||
->batchCheck($this->config->ai->createprompt->requiredFields, 'notempty')
|
||||
->check('name', 'unique')
|
||||
@@ -1672,7 +1672,7 @@ class aiModel extends model
|
||||
public function savePromptFields(int $promptID, array $fields): void
|
||||
{
|
||||
$this->dao->delete()
|
||||
->from(TABLE_AI_PROMPTFIELD)
|
||||
->from(TABLE_AI_AGENTFIELD)
|
||||
->where('appID')->eq($promptID)
|
||||
->exec();
|
||||
|
||||
@@ -1682,7 +1682,7 @@ class aiModel extends model
|
||||
|
||||
if(!isset($field->appID)) $field->appID = $promptID;
|
||||
|
||||
$this->dao->insert(TABLE_AI_PROMPTFIELD)
|
||||
$this->dao->insert(TABLE_AI_AGENTFIELD)
|
||||
->data($field)
|
||||
->exec();
|
||||
}
|
||||
@@ -1727,7 +1727,7 @@ class aiModel extends model
|
||||
/* Override uniqueness error message. */
|
||||
$this->lang->error->unique = $this->lang->ai->validate->nameNotUnique;
|
||||
|
||||
$this->dao->update(TABLE_AI_PROMPT)
|
||||
$this->dao->update(TABLE_AI_AGENT)
|
||||
->data($prompt)
|
||||
->batchCheck($this->config->ai->createprompt->requiredFields, 'notempty')
|
||||
->check('name', 'unique', "`id` != {$prompt->id}")
|
||||
@@ -1754,7 +1754,7 @@ class aiModel extends model
|
||||
$prompt = $this->getPromptById($id);
|
||||
if(empty($prompt)) return false;
|
||||
|
||||
$this->dao->update(TABLE_AI_PROMPT)
|
||||
$this->dao->update(TABLE_AI_AGENT)
|
||||
->set('deleted')->eq(1)
|
||||
->where('id')->eq($id)
|
||||
->exec();
|
||||
@@ -2705,7 +2705,7 @@ class aiModel extends model
|
||||
*/
|
||||
public function getPromptsForUser($module)
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_AI_PROMPT)
|
||||
return $this->dao->select('*')->from(TABLE_AI_AGENT)
|
||||
->where('deleted')->eq(0)
|
||||
->andWhere('module')->eq($module)
|
||||
->andWhere('status')->eq('active')
|
||||
@@ -2857,7 +2857,7 @@ class aiModel extends model
|
||||
*/
|
||||
public function getRoleTemplates()
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_AI_PROMPTROLE)
|
||||
return $this->dao->select('*')->from(TABLE_AI_AGENTROLE)
|
||||
->where('deleted')->eq(0)
|
||||
->fetchAll('id', false);
|
||||
}
|
||||
@@ -2876,7 +2876,7 @@ class aiModel extends model
|
||||
$roleTemplate->role = $role;
|
||||
$roleTemplate->characterization = $characterization;
|
||||
|
||||
$this->dao->insert(TABLE_AI_PROMPTROLE)
|
||||
$this->dao->insert(TABLE_AI_AGENTROLE)
|
||||
->data($roleTemplate)
|
||||
->exec();
|
||||
if(dao::isError()) return false;
|
||||
@@ -2893,7 +2893,7 @@ class aiModel extends model
|
||||
*/
|
||||
public function deleteRoleTemplate($id)
|
||||
{
|
||||
$this->dao->update(TABLE_AI_PROMPTROLE)
|
||||
$this->dao->update(TABLE_AI_AGENTROLE)
|
||||
->set('deleted')->eq(1)
|
||||
->where('id')->eq($id)
|
||||
->exec();
|
||||
@@ -2916,7 +2916,7 @@ class aiModel extends model
|
||||
$roleTemplate->role = $role;
|
||||
$roleTemplate->characterization = $characterization;
|
||||
|
||||
$this->dao->update(TABLE_AI_PROMPTROLE)
|
||||
$this->dao->update(TABLE_AI_AGENTROLE)
|
||||
->data($roleTemplate)
|
||||
->where('id')->eq($id)
|
||||
->exec();
|
||||
|
||||
@@ -1369,7 +1369,7 @@ class aiModelTest extends baseTest
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
$count = $this->instance->dao->select('COUNT(1) AS count')
|
||||
->from(TABLE_AI_PROMPTFIELD)
|
||||
->from(TABLE_AI_AGENTFIELD)
|
||||
->where('appID')->eq($promptID)
|
||||
->fetch('count');
|
||||
return $count;
|
||||
|
||||
@@ -20,7 +20,7 @@ include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/model.class.php';
|
||||
|
||||
// 2. zendata数据准备(根据需要配置)
|
||||
$ai_prompt = zenData('ai_prompt');
|
||||
$ai_prompt = zenData('ai_agent');
|
||||
$ai_prompt->id->range('1');
|
||||
$ai_prompt->name->range('existing_prompt');
|
||||
$ai_prompt->desc->range('这是一个已存在的提示词');
|
||||
|
||||
@@ -20,7 +20,7 @@ include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/model.class.php';
|
||||
|
||||
// 2. zendata数据准备(根据需要配置)
|
||||
$table = zenData('ai_promptrole');
|
||||
$table = zenData('ai_agentrole');
|
||||
$table->role->range('请你扮演一名资深的产品经理。{3}, 你是一名经验丰富的开发工程师。{3}');
|
||||
$table->characterization->range('负责产品战略、设计、开发等。{3}, 精通多种编程语言和框架。{3}');
|
||||
$table->deleted->range('0');
|
||||
|
||||
@@ -18,7 +18,7 @@ cid=15019
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/model.class.php';
|
||||
|
||||
$table = zenData('ai_prompt');
|
||||
$table = zenData('ai_agent');
|
||||
$table->id->range('1-10');
|
||||
$table->name->range('需求润色,一键拆用例,任务润色,需求转任务,Bug润色,代码审查,测试用例生成,API文档生成,项目总结,技术调研');
|
||||
$table->desc->range('优化需求描述,生成测试用例,优化任务描述,转化需求为任务,优化Bug描述,代码质量审查,自动生成测试,API文档自动化,项目总结报告,技术调研分析');
|
||||
|
||||
@@ -20,7 +20,7 @@ include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/model.class.php';
|
||||
|
||||
// 2. zendata数据准备(根据需要配置)
|
||||
$table = zenData('ai_promptrole');
|
||||
$table = zenData('ai_agentrole');
|
||||
$table->id->range('1-10');
|
||||
$table->name->range('产品经理,开发工程师,测试工程师,QA工程师,文案编辑{2},项目经理{2},AI助手{2},自定义角色');
|
||||
$table->role->range('请你扮演一名资深的产品经理,你是一名经验丰富的开发工程师,作为一名资深的测试工程师,假如你是一名资深的QA工程师,你是一名文章写得很好的文案编辑{2},请你扮演一名经验丰富的项目经理{2},你是一个自回归的语言模型{2},你是一名自定义角色');
|
||||
|
||||
@@ -20,8 +20,8 @@ cid=15022
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/model.class.php';
|
||||
|
||||
// 创建ai_prompt测试数据
|
||||
$promptTable = zenData('ai_prompt');
|
||||
// 创建ai_agent测试数据
|
||||
$promptTable = zenData('ai_agent');
|
||||
$promptTable->name->range('测试提示词1,测试提示词2,测试提示词3,测试提示词4,测试提示词5');
|
||||
$promptTable->module->range('story,task,bug,project,testcase');
|
||||
$promptTable->source->range('story.title,task.name,bug.title,project.name,testcase.title');
|
||||
|
||||
@@ -18,7 +18,7 @@ cid=15024
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/model.class.php';
|
||||
|
||||
$table = zenData('ai_prompt');
|
||||
$table = zenData('ai_agent');
|
||||
$table->id->range('1-10');
|
||||
$table->name->range('prompt1,prompt2,prompt3{2},prompt4{3},prompt5{3}');
|
||||
$table->module->range('story{3},task{3},bug{3},testcase');
|
||||
|
||||
@@ -18,7 +18,7 @@ cid=15043
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/model.class.php';
|
||||
|
||||
$table = zenData('ai_prompt');
|
||||
$table = zenData('ai_agent');
|
||||
$table->id->range('1-10');
|
||||
$table->name->range('需求润色,任务润色,Bug润色,文档润色,一键拆用例,需求转任务,生成测试,代码审查,数据分析,流程优化');
|
||||
$table->desc->range('测试描述内容{10}');
|
||||
|
||||
@@ -18,7 +18,7 @@ cid=0
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/model.class.php';
|
||||
|
||||
$table = zenData('ai_promptfield');
|
||||
$table = zenData('ai_agentfield');
|
||||
$table->id->range('1-20');
|
||||
$table->appID->range('1{5},2{5},3{5},999{2},0{3}');
|
||||
$table->name->range('字段1,字段2,字段3,字段4,字段5,字段6,字段7,字段8,字段9,字段10,字段11,字段12,字段13,字段14,字段15,字段16,字段17,字段18,字段19,字段20');
|
||||
|
||||
@@ -18,7 +18,7 @@ cid=15044
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/model.class.php';
|
||||
|
||||
$table = zenData('ai_prompt');
|
||||
$table = zenData('ai_agent');
|
||||
$table->id->range('1-10');
|
||||
$table->name->range('需求润色,一键拆用例,任务润色,需求转任务,Bug润色,文档润色,Bug转需求,拆分一个子计划,测试提示词1,测试提示词2');
|
||||
$table->desc->range('测试描述内容{10}');
|
||||
|
||||
@@ -20,7 +20,7 @@ include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/model.class.php';
|
||||
|
||||
// 2. zendata数据准备
|
||||
$table = zenData('ai_prompt');
|
||||
$table = zenData('ai_agent');
|
||||
$table->id->range('1-10');
|
||||
$table->name->range('prompt1{3},prompt2{3},prompt3{2},prompt4{1},prompt5{1}');
|
||||
$table->module->range('story{3},task{3},bug{2},project{1},user{1}');
|
||||
|
||||
@@ -20,7 +20,7 @@ include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/model.class.php';
|
||||
|
||||
// 2. zendata数据准备
|
||||
$table = zenData('ai_promptrole');
|
||||
$table = zenData('ai_agentrole');
|
||||
$table->id->range('1-10');
|
||||
$table->name->range('系统分析师,项目经理,开发工程师,测试工程师,产品经理,技术专家,AI助手,客服代表,[],特殊角色');
|
||||
$table->desc->range('专注于系统需求分析和架构设计,负责项目整体规划和管理,专注于代码开发和技术实现,负责软件质量保证和测试,负责产品规划和需求管理,提供技术咨询和解决方案,智能化辅助工具,客户服务支持,[],特殊角色描述');
|
||||
|
||||
@@ -20,7 +20,7 @@ include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/model.class.php';
|
||||
|
||||
// 2. zendata数据准备(根据需要配置)
|
||||
$table = zenData('ai_prompt');
|
||||
$table = zenData('ai_agent');
|
||||
$table->id->range('1-10');
|
||||
$table->name->range('状态切换测试1,状态切换测试2,状态切换测试3,状态切换测试4,状态切换测试5,状态切换测试6,状态切换测试7,状态切换测试8,状态切换测试9,状态切换测试10');
|
||||
$table->desc->range('测试状态切换功能的提示词描述{10}');
|
||||
|
||||
@@ -22,7 +22,7 @@ include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/model.class.php';
|
||||
|
||||
// 2. zendata数据准备(根据需要配置)
|
||||
$promptTable = zenData('ai_prompt');
|
||||
$promptTable = zenData('ai_agent');
|
||||
$promptTable->id->range('1-20');
|
||||
$promptTable->name->range('需求润色,一键拆用例,项目分析,产品评审,任务拆解,缺陷修复,文档生成,代码评审,测试计划,执行分析,用例设计,项目管理,产品规划,需求分析,bug分析,story优化,task创建,project总结,execution监控,doc编写');
|
||||
$promptTable->module->range('story{3},task{3},project{3},product{3},execution{3},bug{2},case{2},doc{1}');
|
||||
|
||||
@@ -19,7 +19,7 @@ cid=15078
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/model.class.php';
|
||||
|
||||
$table = zenData('ai_prompt');
|
||||
$table = zenData('ai_agent');
|
||||
$table->id->range('1-10');
|
||||
$table->name->range('提示1,提示2,提示3,提示4,提示5,提示6,提示7,提示8,提示9,提示10');
|
||||
$table->desc->range('描述1,描述2,描述3,描述4,描述5,描述6,描述7,描述8,描述9,描述10');
|
||||
|
||||
@@ -18,7 +18,7 @@ cid=15079
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/model.class.php';
|
||||
|
||||
$table = zenData('ai_promptrole');
|
||||
$table = zenData('ai_agentrole');
|
||||
$table->id->range('1-10');
|
||||
$table->name->range('产品经理,开发工程师,测试工程师,QA工程师,文案编辑,项目经理');
|
||||
$table->desc->range('负责产品管理,负责开发工作,负责测试工作,负责质量管理,负责文案编辑,负责项目管理');
|
||||
|
||||
@@ -13118,7 +13118,7 @@ class upgradeModel extends model
|
||||
unset($aiPrompt->id);
|
||||
$aiPrompt->createdBy = 'system';
|
||||
$aiPrompt->createdDate = helper::now();
|
||||
$this->dao->insert(TABLE_AI_PROMPT)->data($aiPrompt)->autoCheck()->exec();
|
||||
$this->dao->insert(TABLE_AI_AGENT)->data($aiPrompt)->autoCheck()->exec();
|
||||
|
||||
$promptID = $this->dao->lastInsertID();
|
||||
if(!empty($this->config->ai->initAIPromptFields[$index])) $this->initAIPromptFields($this->config->ai->initAIPromptFields[$index], $promptID);
|
||||
@@ -13135,7 +13135,7 @@ class upgradeModel extends model
|
||||
*/
|
||||
public function checkExistAIPrompt(object $aiPrompt): bool
|
||||
{
|
||||
$count = $this->dao->select('COUNT(1) AS count')->from(TABLE_AI_PROMPT)
|
||||
$count = $this->dao->select('COUNT(1) AS count')->from(TABLE_AI_AGENT)
|
||||
->where('name')->eq($aiPrompt->name)
|
||||
->fetch('count');
|
||||
return $count == 0;
|
||||
@@ -13185,7 +13185,7 @@ class upgradeModel extends model
|
||||
foreach($aiPromptFields as $field)
|
||||
{
|
||||
$field->appID = $promptID;
|
||||
$this->dao->insert(TABLE_AI_PROMPTFIELD)->data($field, 'id')->exec();
|
||||
$this->dao->insert(TABLE_AI_AGENTFIELD)->data($field, 'id')->exec();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user