-
Notifications
You must be signed in to change notification settings - Fork 59.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Tips] 如何使用用户输入模板 How to use Input Template
#2144
Comments
Title: [Tips] How to use In the recent update, I added the Input Template feature, which you can review at this link: #1789 This configuration item can be changed in both global and dialogue settings, with different ranges of influence. Different pre-processing templates result in different effects. In short, you can use the following variables in the template:
For example, in the initial version, I set the default template as:
So if the user enters "how are you today?", according to the above template, the content sent to ChatGPT will be:
However, this default template can pollute the user's preset prompt words under certain circumstances. Therefore, in the current version, I changed it to the most basic: Later, I found that the system prompt words used by OpenAI's web version of ChatGPT are:
So I will inject this prompt globally next to provide an experience as close as possible to the official one. |
OpenAI 网页版所用的 System Prompt 来源(中文链接):https://www.zhihu.com/answer/3090442006 |
Source of System Prompt used by OpenAI web version (Chinese link): https://www.zhihu.com/answer/3090442006 |
因此,现在默认的就是这个 |
Therefore, the default is |
@Mydong 是的,无需再进行改动。 |
@Mydong Yes, no further changes needed. |
能在用户设置预设system prompt加上{{time}}的注入吗,毕竟这段system prompt也不需要每次输入都加上。 |
Can the injection of {{time}} be added to the user setting default system prompt |
好像找到了,所以是不是只是预设提示词展示的没有被替换,实际上发送的被替换了? |
It seems to be found, so is it just that the preset prompt words have not been replaced, but the sent ones have been replaced? |
feat: ChatGPTNextWeb#2144 improve input template
如果我想要按照自己接口的格式进行封装数据,我应该如何进行更改? 那么我应该如何在chatgpt_next_web代码中进行更改? |
If I want to encapsulate data according to the format of my own interface, how should I change it? So how should I make changes in chatgpt_next_web code? |
feat: ChatGPTNextWeb#2144 improve input template
在最近的一次更新中,我增加了 Input Template 这个功能,讨论可以看这里:#1789
该配置项可以在全局设置和对话设置中更改,影响的范围也不一样,同时不同的预处理模板,产生的效果也不同。
总而言之,你可以在模板中使用下方的变量:
https://github.com/Yidadaa/ChatGPT-Next-Web/blob/5f7c262759b93c6becc636b7b0cab2a183c956fe/app/store/chat.ts#L110-L116
举个例子,在最开始的版本中,我设定的默认模板是:
那么如果用户输入了
how are you today?
,根据上述模板,发送给 ChatGPT 的内容会变成:然而,这个默认模板会在某些情况下污染用户的预设提示词,所以在当前的版本中,我又改成了最基础的:
https://github.com/Yidadaa/ChatGPT-Next-Web/blob/5f7c262759b93c6becc636b7b0cab2a183c956fe/app/constant.ts#L56
后来,我发现 OpenAI 的网页版 ChatGPT,用的系统提示词是:
所以,我接下来会将此提示词全局注入,来尽可能接近官方的使用体验。
The text was updated successfully, but these errors were encountered: