From a6597b44c3e3dcc2f5d377bc9d352ecf3cfa7cb2 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Fri, 26 Sep 2025 19:00:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96Ai=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E8=AF=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Module/AI.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/Module/AI.php b/app/Module/AI.php index 8aced2baf..cac8e5577 100644 --- a/app/Module/AI.php +++ b/app/Module/AI.php @@ -319,7 +319,7 @@ class AI /** * 通过 openAI 生成任务标题和描述 - * @param string $text 任务描述 + * @param string $text 用户提供的提示词 * @param array $context 上下文信息 * @return array */ @@ -381,7 +381,7 @@ class AI ], [ "role" => "user", - "content" => $contextPrompt . "\n\n请根据以上上下文和以下用户描述生成一个完整的项目任务(包含标题和详细描述):\n\n" . $text + "content" => $contextPrompt . "\n\n请根据以上上下文并结合以下提示词生成一个完整的项目任务(包含标题和详细描述):\n\n" . $text ] ], ]); @@ -445,7 +445,7 @@ class AI /** * 通过 openAI 生成项目名称与任务列表 - * @param string $text 项目需求或描述 + * @param string $text 用户提供的提示词 * @param array $context 上下文信息 * @return array */ @@ -453,7 +453,7 @@ class AI { $text = trim((string)$text); if ($text === '') { - return Base::retError("项目描述不能为空"); + return Base::retError("项目提示词不能为空"); } $context['current_name'] = trim($context['current_name'] ?? ''); @@ -512,7 +512,7 @@ class AI ], [ "role" => "user", - "content" => ($contextPrompt ? $contextPrompt . "\n\n" : "") . "请根据以上信息,为以下需求生成适合的项目名称和任务列表:\n\n" . $text + "content" => ($contextPrompt ? $contextPrompt . "\n\n" : "") . "请根据以上信息,并结合以下提示词生成适合的项目名称和任务列表:\n\n" . $text ], ], ]); @@ -557,7 +557,7 @@ class AI /** * 通过 openAI 生成聊天消息 - * @param string $text 消息需求描述 + * @param string $text 用户提供的提示词 * @param array $context 上下文信息 * @return array */ @@ -565,7 +565,7 @@ class AI { $text = trim((string)$text); if ($text === '') { - return Base::retError("消息需求不能为空"); + return Base::retError("消息提示词不能为空"); } $contextPrompt = self::buildMessageContextPrompt($context); @@ -593,7 +593,7 @@ class AI ], [ "role" => "user", - "content" => ($contextPrompt ? $contextPrompt . "\n\n" : "") . "请根据以上信息,为以下需求生成一条待发送的消息:\n\n" . $text + "content" => ($contextPrompt ? $contextPrompt . "\n\n" : "") . "请根据以上信息,并结合以下提示词生成一条待发送的消息:\n\n" . $text ], ], ]);