推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
pppan
V2EX  ›  Python

ChatGPT 命令行版

  •  1
     
  •   pppan · Mar 3, 2023 · 4754 views
    This topic created in 1348 days ago, the information mentioned may be changed or developed.

    特点:

    • 适用于终端爱好者
    • 自带语法高亮
    • 支持上下文
    • 支持代理

    源码: https://github.com/evilpan/gptcli

    预览:

    Supplement 1  ·  Mar 4, 2023

    更新:

    1. 支持多行输入,参考 help 命令
    2. 感谢 @whatthehell,现在已经支持 stream 模式,可以在命令行实时进行渲染!

    12 replies  •  2023-03-06 19:27:48 +08:00
    b1ghawk
    b1ghawk
    Mar 3, 2023 via Android
    1
    shower!
    whatthehell
    whatthehell
    Mar 3, 2023
    2
    有没有流式输出版本
    pppan
    pppan
    OP
    Mar 3, 2023
    3
    @whatthehell API 好像都是一次性怼回来的 JSON 啊
    wander555
    wander555
    Mar 3, 2023❤️1
    4
    windows 用不了 readline ,最好换成 pyreadline3
    linux 用当我没说
    ptrees
    ptrees
    Mar 3, 2023
    6
    不好使,但是学到了一个 openai.proxy,感谢
    mmxq
    mmxq
    Mar 3, 2023❤️1
    7
    Windows 下无法使用“readline”module ,pip install pyreadline3 即可运行此脚本。
    小工具吧可是说是,感谢作者!🙇‍
    然后网上这种类似的 chatgpt 命令行工具还有好多,类似: https://github.com/loclink/chatgpt-prompts
    大伙可以自己去玩玩~
    pppan
    pppan
    OP
    Mar 3, 2023
    8
    参考大家的建议,优化了一些 Windows 下的报错。这个脚本主要是比较轻量,平时用来查代码的。有需要的朋友也可以在此基础上修改下 Prompt ,打造自己专属的 AI 小助手。
    whatthehell
    whatthehell
    Mar 3, 2023
    9
    @pppan
    有流式的,套壳网站都是流式的,看看 stream 参数
    https://platform.openai.com/docs/api-reference/chat/create

    stream: Defaults to false
    If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message.
    pppan
    pppan
    OP
    Mar 4, 2023
    10
    @whatthehell 刚刚适配了一下,已经支持流式版本啦!
    mingwiki
    mingwiki
    Mar 6, 2023
    11
    用上了感觉还可以哦,可以直接引入文件吗 想让 gpt 帮我改改代码
    pppan
    pppan
    OP
    Mar 6, 2023
    12
    @mingwiki 可以拷贝文件内容然后多行粘贴进去
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4505 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 76ms · UTC 06:09 · PVG 14:09 · LAX 22:09 · JFK 01:09
    ♥ Do have faith in what you're doing.