@@ -534,6 +534,7 @@ void InlineChatWidgetPrivate::processGeneratedData(const QString &data)
534534{
535535 editSrv->clearAllBackgroundColor (chatInfo.fileName , selectionMarker);
536536 chatInfo.operationRange .clear ();
537+ chatInfo.diffList .clear ();
537538 chatInfo.destText = data;
538539 if (chatInfo.originalText .isEmpty ())
539540 chatInfo.diffList << Diff { INSERT, data };
@@ -594,15 +595,31 @@ QString InlineChatWidgetPrivate::createPrompt(const QString &question, bool useC
594595 }
595596
596597 QStringList prompt;
598+ prompt << " 你是一位智能编程助手,你叫CodeGeeX。你会为用户回答关于编程、代码、计算机方面的任何问题,"
599+ " 并提供格式规范、可以执行、准确安全的代码,并在必要时提供详细的解释。任务:根据用户的Command作答。"
600+ " \n You are working on a task with User in a file and User send a message to you. "
601+ " `【cursor】` indicate the current position of your cursor, delete it after modification."
602+ " \n\n Your Workflow:\n Step 1: You should working on the command step-by-step:\n 1. "
603+ " Does the command is about to write program or comments in programming task? Write out the "
604+ " type of the command: (Choose: Chat / Programming).\n - **Chat command**: When your aim to "
605+ " reply through explanations, reminders, or requests for additional information. "
606+ " \n - **Programming command**: The user command is clear and requires you to write program "
607+ " or comments. \n Step 2: If it's a chat command, provide a thoughtful and clear response "
608+ " {language} directly.\n Step 3: If it requires programming, you should complete the Task "
609+ " according to the given file. \n a. Understand the message in order to tackle it correctly: "
610+ " is the task about coding or debugging?\n - For coding, add new code within the task to execute "
611+ " the user's instructions correctly. \n - For debugging, improve the code to fix the bug, write "
612+ " the reasons for the changes within your code as comments.\n b. You should complete the task "
613+ " according to user request and comment in Chinese within your code to indicate changes. \n c. "
614+ " You should place only the finished task in a single block as output without explain!!!\n\n "
615+ " Reply in the template below:\n Command Type: (Chat / Programming)\n Response: (Your response / "
616+ " Finished code in one block)\n\n " ;
617+
597618 prompt << " 针对这段代码,回答我的问题。问题:" ;
598619 prompt << question;
599620 prompt << " 代码:\n ```" ;
600621 prompt << chatInfo.originalText ;
601622 prompt << " ```" ;
602- prompt << " 要求:" ;
603- if (state == SubmitStart)
604- prompt << " 回答的内容中包含代码;" ;
605- prompt << " 生成的代码需要与上面提供代码的缩进保持一致" ;
606623
607624 if (useChunk) {
608625 prompt << " 回答内容不要使用下面的参考内容" ;
0 commit comments