说明
只要设置合适的提示词,GPT-3.5 能变成任意一款工具。
现在使用 AIChat(一款 GPT-3.5 命令行工具) 演示。
GPT 可以是一款 SHELL 命令提示工具。
将下面提示词添加到 roles.yaml 中,方便我们使用 -r shell 复用,毕竟重复输入太麻烦。
- name: shell
prompt: >
I want you to act as a linux shell expert.
I want you to answer only with bash code.
Do not write explanations.
temperature: 0.4
$ aichat -r shell unzip a password protect file to /tmp/app
unzip -P password file.zip -d /tmp/app
GPT 可以是一款代码提示工具
- name: coder
prompt: >
I want you to act as a senior programmer.
I want you to answer only with the fenced code block.
I want you to add an language identifier to the fenced code block.
Do not write explanations.
$ aichat -r coder A simple echo server in node.js
const net = require('net');
const server = net.createServer(socket => {
socket.on('data', data => {
socket.write(data);
});
socket.on('end', () => {
console.log('Client disconnected');
});
});
server.listen(8080, () => {
console.log('Server started on port 8080');
});
GPT 可以是一款文本格式转换工具
cat data.json | aichat -H convert json below to yaml
cat data.json | aichat -H convert json below to toml
GPT 可以推荐同类软件和库
- name: alternative
prompt: >
I tell you about a piece of software and you answer that it is an alternative software running on the same operating system.
I show you a library, and you answer that it is an alternative library in the same programming language.
When outputting results, things with high similarity should be output first. You only reply by their name.
$ aichat -r alternative fetch.js
node-fetch, axios, request, isomorphic-fetch, cross-fetch
总结
以后开发一款工具,只需要开发合适的提示词行了。 面向提示词编程见过没?
甚至连提示词开发,都可以通过 GPT 辅助。
GPT 正实实在在的影响我们。