V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
sigoden
V2EX  ›  分享发现

GPT3.5 真是一款万能工具,是时候清理下工具箱了

  •  1
     
  •   sigoden · 2023-03-10 11:07:53 +08:00 · 4434 次点击
    这是一个创建于 384 天前的主题,其中的信息可能已经有所发展或是发生改变。

    说明

    只要设置合适的提示词,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 正实实在在的影响我们。

    22 条回复    2023-03-17 09:50:59 +08:00
    1423
        1
    1423  
       2023-03-10 11:58:13 +08:00   ❤️ 4
    我其实不太理解一对人做这种二次封装
    推特上有一堆人,乐此不疲

    直接用官方页面解决不了吗?还不受限于封装限定的 prompt
    ragnaroks
        2
    ragnaroks  
       2023-03-10 12:15:50 +08:00
    @1423 因为能力不足以扩展,但又要蹭热度。我们公司这几天也在搞这种东西,烦死了。
    sigoden
        3
    sigoden  
    OP
       2023-03-10 12:16:50 +08:00   ❤️ 4
    @1423 你是不是看都没看就开始喷了。我这个怎么受限于封装限定的 prompt 了。明明想加什么 prompt 可以任意加。

    GPT 接口更便宜,更快,性能更稳定。
    命令行终端也有很多实用场景和用户,比如上面的文件转换列子,终端下明显更方便吧。
    请对无偿提供工具服务的志愿者多点耐心。不喜欢请无视。
    justincnn
        4
    justincnn  
       2023-03-10 12:16:59 +08:00
    @1423 一可以解决部分人没法科学上网的问题,二是对一些特定领域的人降低使用门槛,最近 b 站上教人用 cgatgpt 做跨境电商文案的,比比皆是,又一个人的收费是对话一次,收取 1 块钱,还口口声声说这个只赚个口碑,真的脸也不要了,哈哈
    em70
        5
    em70  
       2023-03-10 12:19:46 +08:00
    @1423 稍微高级点的应用需要精心编写 prompt,一般人写不了,就算能写每次都要多打那么多字麻烦
    sigoden
        6
    sigoden  
    OP
       2023-03-10 12:23:59 +08:00   ❤️ 1
    贴一个生成 prompt 的 prompt

    ```yaml

    - name: PromptGenerator
    prompt: >
    Act like PromptGPT. As PromptGPT, you are an AI that will write prompts to ChatGPT to make it act in a manner which I will specify.
    In doing so you will be as specific and thorough as possible in specifying the way ChatGPT should act.
    In every prompt you create, you will also tell ChatGPT to act in the specified manner for the duration of the conversation.
    I will prompt you in format [Manner for you to tell Chat GPT to act]
    and you will reply in format "PromptGPT: [Prompt for ChatGPT to act in specified manner]."
    No additional formatting will be used on your part, if my formatting differs, you will only revise your response appropriately.
    ```
    ```
    aichat -r PromptGenerator Act like a english-chinsee translator
    ```
    一些简单任务可以使用自动生成的 prompt 。
    1423
        7
    1423  
       2023-03-10 12:27:11 +08:00
    @em70 这些“一般人”会装一个命令行工具解决这些“麻烦”吗?
    caomu
        8
    caomu  
       2023-03-10 13:31:20 +08:00 via Android
    封装 /抽象也是一种很重要的能力和工作吧,就像写代码遇到公用模块也会抽象出来。很多热门预言也会有语法糖(虽然有些原教旨 geek 不喜欢语法糖)。在未来几年,面向 AI 的提示工程应该会是热门。日常有很多工作都是重复性的,不可能我每次都复制粘贴一堆提示词吧。抽象成一个封装层也挺好的。AI 提示工程,很可能会和低代码技术融合,变成新的办公利器。前段时间推出 demo 的 chatexcel 就是一个例子。
    caomu
        9
    caomu  
       2023-03-10 13:31:49 +08:00 via Android
    热门预言 -> 热门语言
    leadfast
        10
    leadfast  
       2023-03-10 13:44:12 +08:00
    请教下 roles.yaml 文件要放哪儿呢
    leadfast
        11
    leadfast  
       2023-03-10 13:55:23 +08:00
    @leadfast 啊哈,输入 .info 可以看到
    probe301
        12
    probe301  
       2023-03-10 14:06:20 +08:00   ❤️ 1
    请尊重无偿提供工具的人, 即使这些工具只是个简单包装

    1 我能驾驭新鲜的生产力工具, 但最好只有我会, 其他人都不懂 /用不着, 才最好

    2 我能驾驭新鲜的生产力工具, 且会分享出来, 但只跟有同样价值的人交换

    3 我尽量让所有人都能看到好处, 并提供便利让大家都能用上

    我很敬佩第三种人, 无论他出于什么动机

    另外楼主你这个 "Act like a english-chinsee translator" 拼错了, 但一般不碍事
    pipaseqin
        13
    pipaseqin  
       2023-03-10 14:20:10 +08:00
    不错,人手一个 XXX 的时代又来临了。
    https://gpt2go.netlify.app/
    haoxuexiaoyao
        14
    haoxuexiaoyao  
       2023-03-10 14:20:54 +08:00
    @sigoden 谢谢分享 非常实用 不用在意键盘侠 哈哈 需要的人自然会感觉好用
    lookStupiToForce
        15
    lookStupiToForce  
       2023-03-10 15:31:22 +08:00   ❤️ 1
    cli 的任何工具箱本身就是挺好的玩意儿,加上 chatgpt 达到类似 all in one 的效果不要更棒
    我不懂喷的人的喷点

    难道这些人是在喷 “为什么不自己用 gpt api 造个 cli 轮子” 🤨?🤨?🤨?
    RanceA
        16
    RanceA  
       2023-03-10 16:54:50 +08:00
    chatgpt 官方版推荐的同类软件和库,我自己这边试过几次,除非太常用的否则基本都不对
    kaneg
        17
    kaneg  
       2023-03-10 21:03:05 +08:00 via iPhone
    挺好的一个工具,一般人想不到这些 prompt 。请问如何获取 api key ?
    yazoox
        18
    yazoox  
       2023-03-11 16:27:28 +08:00
    OP 请教一下,
    使用这个 aichat 因为要提供 api key ,我注册了 openai 的帐号,然后登录,生成 API Key ,那是不是要收费了?
    我注册的时候并没有绑定信用卡,怎么收费或者扣费?
    sigoden
        19
    sigoden  
    OP
       2023-03-11 16:37:17 +08:00
    @yazoox 新账号有免费赠送额度。👉 https://platform.openai.com/account/usage
    iorilu
        20
    iorilu  
       2023-03-12 11:04:02 +08:00
    新账号送 5 美元
    iorilu
        21
    iorilu  
       2023-03-12 11:04:44 +08:00
    @kaneg 很多地方卖, 行情是 6 块左右一个, 带 5 美元额度
    Victorcao
        22
    Victorcao  
       2023-03-17 09:50:59 +08:00 via Android
    @sigoden 醒醒吧,别再瞎蹭热度了。沉下心来当韭菜不香吗?答应我,你要努力啊!
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3106 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 12:57 · PVG 20:57 · LAX 05:57 · JFK 08:57
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.