ChatGPT 命令行版

2023-03-03 12:54:52 +08:00
 pppan

特点:

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

预览:

3013 次点击
所在节点    Python
12 条回复
b1ghawk
2023-03-03 13:09:35 +08:00
shower!
whatthehell
2023-03-03 14:14:59 +08:00
有没有流式输出版本
pppan
2023-03-03 14:47:40 +08:00
@whatthehell API 好像都是一次性怼回来的 JSON 啊
wander555
2023-03-03 15:10:33 +08:00
windows 用不了 readline ,最好换成 pyreadline3
linux 用当我没说
howardlau
2023-03-03 15:17:46 +08:00
ptrees
2023-03-03 16:10:07 +08:00
不好使,但是学到了一个 openai.proxy,感谢
mmxq
2023-03-03 16:28:58 +08:00
Windows 下无法使用“readline”module ,pip install pyreadline3 即可运行此脚本。
小工具吧可是说是,感谢作者!🙇‍
然后网上这种类似的 chatgpt 命令行工具还有好多,类似: https://github.com/loclink/chatgpt-prompts
大伙可以自己去玩玩~
pppan
2023-03-03 17:03:55 +08:00
参考大家的建议,优化了一些 Windows 下的报错。这个脚本主要是比较轻量,平时用来查代码的。有需要的朋友也可以在此基础上修改下 Prompt ,打造自己专属的 AI 小助手。
whatthehell
2023-03-03 20:31:48 +08:00
@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
2023-03-04 11:13:22 +08:00
@whatthehell 刚刚适配了一下,已经支持流式版本啦!
mingwiki
2023-03-06 15:10:55 +08:00
用上了感觉还可以哦,可以直接引入文件吗 想让 gpt 帮我改改代码
pppan
2023-03-06 19:27:48 +08:00
@mingwiki 可以拷贝文件内容然后多行粘贴进去

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/920795

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX