优化LLM提示词
This commit is contained in:
@@ -1,17 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
|
||||
|
||||
@@ -21,15 +15,8 @@ using CommunityToolkit.Mvvm.Messaging;
|
||||
using LangChain.Providers;
|
||||
using LangChain.Providers.DeepSeek;
|
||||
using LangChain.Providers.DeepSeek.Predefined;
|
||||
using LangChain.Providers.OpenAI.Predefined;
|
||||
|
||||
using Markdig;
|
||||
|
||||
using Markdig.Syntax;
|
||||
using Markdig.Wpf.ColorCode;
|
||||
|
||||
|
||||
using tryAGI.OpenAI;
|
||||
//using LangChain.Schema;
|
||||
|
||||
//using static LangChain.Chains.Chain;
|
||||
@@ -142,13 +129,13 @@ public partial class ChatDialogueViewModel : ObservableObject
|
||||
{
|
||||
if (ChatHistory.Count == 0)
|
||||
{
|
||||
CurrentRequest += Message.Human($"你是专业的Revit二次开发工程师,不随意捏造事实,能客观地回答用户的问题,对于不确定或难以理解的问题,需要用户补充说明的,需要主动提出。你需要在{GlobalVariables.UIApplication.Application.VersionName}二次开发中,使用已定义的uidoc、doc两个变量,构造一个可以正确执行的C#代码块,保证使用的RevitAPI的所有方法都能在{GlobalVariables.UIApplication.Application.VersionName}版本的API文档中找到,在代码中添加关键的注释,不需要Excute方法签名和using命名空间,使用类声明对象时,需要完整的命名空间。需求是:{UserInput}");
|
||||
ChatHistory.Add(CurrentRequest);
|
||||
var systemPrompt = new PromptManager(Path.Combine(GlobalVariables.DirAssembly, "Templates/SystemPrompt.txt")).GetSystemPrompt();
|
||||
CurrentRequest += Message.Ai($"{systemPrompt}\n\r注意当前的Revit版本是:{GlobalVariables.UIApplication.Application.VersionName}");
|
||||
ChatHistory.Add(Message.Human($"{UserInput}"));
|
||||
}
|
||||
else
|
||||
{
|
||||
ChatHistory.Add(Message.Human(UserInput));
|
||||
|
||||
CurrentRequest += Message.Human(UserInput);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user