目前自己写的效果不是很好,模型是通义千问,经常重复补全(就是把光标后面已有的代码重复了一遍)或者胡言乱语。社区有开源的效果比较好 prompt 吗?
看了一下 continue 的 template,感觉没什么参考价值。其中 starcoder 等是专门训练的 code 补全模型,不需要特别的 prompt 。
以下是自己写的 prompt:
I am calling you in a code completion plugin for an editor. I need you to complete the code based on the context provided below, only providing the completion content.
# Code Context
Here is the beginning part of the ${language} code (before the cursor):
```
${input.prefix}
```
Here is the suffix part (after the cursor):
```
${input.suffix}
```
Do not explain, just return the code between the prefix part and the suffix part, and do not include the prefix part or the suffix part. Your completion should be concise and accurate. You need to note that brackets, etc. I may have provided them to you in suffix.
1
vacuitym 98 天前
好像 claude 有个专门写 prompt 的服务
|
2
gitignore 98 天前
似乎你也没告诉 llm 要做什么事啊😧让 llm 从的给定的代码上下文推测代码需要实现的功能不靠谱,好歹得让用户描述一下业务逻辑不是,或许从交互上改一下,比如用户写一段注释描述逻辑,再调用 llm
|