爱意满满的作品展示区。
guoph

AskGPT: 在任意窗口让 ChatGPT 代替你进行输入

  •  1
     
  •   guoph · Mar 26, 2023 · 5372 views
    This topic created in 1328 days ago, the information mentioned may be changed or developed.

    AskGPT 是一个 Alfred Workflow ,它能让你在任意窗口输入 \\gpt,以启用 ChatGPT 代替你进行接下来的输入。帮你回邮件,帮你写代码,帮你写论文,...

    GitHub: https://github.com/phguo/AskGPT (点开有用例视频)

    Supplement 1  ·  Apr 2, 2023

    更新了版本(https://github.com/phguo/AskGPT/releases/tag/v0.6):

    • 增加了上下文,可设置传输给 ChatGPT 的最大历史记录消息条数和过期时间,例如,20 分钟后自动使上下文失效。

    • 可自定义 ChatGPT 模型和 temprature。

    • 增加了用户自定义的 roles,可通过输入,例如 *debug, 使用。

    29 replies  •  2023-04-07 09:03:26 +08:00
    zeonll
    zeonll
    Mar 26, 2023
    1
    感谢 op ,真的很实用
    ourongxing
    ourongxing
    Mar 26, 2023
    2
    真打字机效果,看上去不错,不过我用 Raycast 。
    yuw9470635
    yuw9470635
    Mar 26, 2023
    3
    这个是只有 mac 能用吗
    timqian
    timqian
    Mar 26, 2023
    4
    很棒
    guoph
    guoph
    OP
    Mar 27, 2023
    5
    @yuw9470635 是的,因为基于 Alfred
    haozes
    haozes
    Mar 27, 2023
    6
    有创意。就是在输入框还要输不少错,有点费事,不知道会不会加更多垂直场景效果更好
    tommyxps
    tommyxps
    Mar 27, 2023
    7
    能哦添加上下文以及 role 配置?
    guoph
    guoph
    OP
    Mar 28, 2023
    8
    @tommyxps 已加入代办。但是基于什么原则保留上下文,问题数量,时间,还是别的什么。有没有建议
    fg990
    fg990
    Mar 29, 2023
    9
    PYTHON_ENV ,这个字段要如何填写,小白请教。
    @guoph
    fg990
    fg990
    Mar 29, 2023
    10
    请教了 ChatGPT ,还是不明白😄

    你是计算机专家,请解释以下:PYTHON_ENVopenai: 安装了, keybord,的 Python 环境 pyperclip 。注意 Alfred Workflow 必须使用 Python 的绝对目录,可以通过 which pythonin 找到。Terminal

    ----------------------------------------------------------------
    首先,让我们对这段文字进行拆分和解释:

    PYTHON_ENVopenai:这是一个环境变量的名称,可能是在某个程序或脚本中定义的。这个环境变量可能指定了某个 Python 环境的路径或配置。
    安装了 keybord, 的 Python 环境 pyperclip:这个环境中安装了两个 Python 库( keybord 和 pyperclip ),这些库可以被程序或脚本所调用。
    注意 Alfred Workflow 必须使用 Python 的绝对目录,可以通过 which python 找到:这句话告诉我们,在使用 Alfred Workflow 时,必须使用 Python 的绝对路径来确保正确使用环境中安装的 Python 版本。可以通过在终端中运行 "which python" 命令来找到 Python 的绝对路径。
    综合起来,这段文字提供了关于一个特定 Python 环境的信息,其中包括环境变量名称、安装的库和必要的使用说明。
    xy19009188
    xy19009188
    Mar 29, 2023
    11
    同小白,除了 api ,别的都没有配置成功
    fg990
    fg990
    Mar 29, 2023
    12
    谢谢楼主,用上了。

    ChatGPT 是一个百问不厌的好老师,根据楼主给定的要求,在 ChatGPT 的指导下:
    fg990
    fg990
    Mar 29, 2023
    13
    1 、升级了 PIP ;
    fg990
    fg990
    Mar 29, 2023
    14
    ChatGPT 是一个百问不厌的好老师,根据楼主给定的要求,在 ChatGPT 的指导下:
    1 、升级了 PIP ;
    2 、安装了 openai, keyboard 和 pyperclip ,三个 python 库。 [楼主的“keybord”,应该为“keyboard”,少了一个“a”]

    目前已经可以正常使用楼主的 AskGPT
    fg990
    fg990
    Mar 29, 2023
    15
    @xy19009188

    基础环境:可以网页端正常访问 ChatGPT ;

    安装步骤:
    1 、下载 AskGPT ;
    从 https://github.com/phguo/AskGPT/releases 下载

    2 、安装 AskGPT 到 Alfred ;
    将 AskGPT 拖入 Alfred

    3 、设置 API-KEY ;
    从 https://platform.openai.com/account/api-keys 获取的 OpenAI API 密钥

    4 、安装 openai,、keyboard 和 pyperclip ,三个 python 库;
    打开命令行终端( Command Prompt 或 Terminal 等)
    分别执行:
    pip install openai
    pip install keyboard
    pip install pyperclip

    5 、设置 python 的绝对路径
    打开命令行终端( Command Prompt 或 Terminal 等)
    执行:
    which python3
    将输出的结果复制,填写到 AskGPT 配置文件中的 PYTHON_ENV 字段
    我电脑的 python3 的绝对路径是:“/usr/local/bin/python3”,你可以尝试去掉引号,直接填写到 PYTHON_ENV 字段

    END
    fg990
    fg990
    Mar 29, 2023
    16
    不知道如何编辑已经发布的帖子,再发一遍
    christin
    christin
    Mar 29, 2023
    17
    看到你发的这个我去查了一下 raycasy 也有对应的插件了,感谢提醒
    zeonll
    zeonll
    Mar 29, 2023
    18
    @fg990 AskGPT 配置文件中的 PYTHON_ENV
    zeonll
    zeonll
    Mar 29, 2023
    19
    配置文件怎么查看啊
    fg990
    fg990
    Mar 29, 2023
    20
    不会发图。

    按以下顺序:

    alfred-Preferences...-Workflows-AskGPT-右上角的 [X]
    @zeonll
    guoph
    guoph
    OP
    Apr 2, 2023
    21
    @tommyxps 已增加
    guoph
    guoph
    OP
    Apr 2, 2023
    22
    @fg990 可以参考更新过的 README.md
    tommyxps
    tommyxps
    Apr 3, 2023
    23
    @guoph 棒棒的!发现一个问题,已提交 issue
    fg990
    fg990
    Apr 3, 2023
    24
    @guoph 升级后无法使用,退回到 0.5 版了
    utre938722
    utre938722
    Apr 4, 2023
    25
    什么时候可以出个 windows 版本的
    guoph
    guoph
    OP
    Apr 4, 2023
    26
    @fg990 已更新 https://github.com/phguo/AskGPT/releases/tag/v0.6.1 。不能使用出错信息是什么呢,可以开 Alfred 的调试模式看下。感谢反馈!
    fg990
    fg990
    Apr 6, 2023
    27
    @guoph 0.61 也不行,调试模式记录如下:
    [16:49:57.968] Logging Started...
    [16:50:09.397] AskGPT[Keyword] Processing complete
    [16:50:09.398] AskGPT[Keyword] Passing output '心情' to Run Script
    [16:50:10.197] ERROR: AskGPT[Run Script] Traceback (most recent call last):
    File "/Users/test/Documents/Alfred.alfredpreferences/workflows/user.workflow.BC57467B-A21E-484D-9D19-FE3672C60900/gpt.py", line 99, in <module>
    api_key, model, temprature, messages, signature, print_input, chat_number = pre_process(*params)
    TypeError: pre_process() missing 9 required positional arguments: 'model', 'temprature', 'context_time', 'chat_number', 'clear_keyword', 'clipboard_keyword', 'roles', 'signature', and 'print_input'
    guoph
    guoph
    OP
    Apr 6, 2023
    28
    @fg990 用的 Alfred 5 吗? v0.6 把部分配置从 Environment Variables 移到了 User Configuration 。User Configuration 是 Alfred 5 的新特性
    fg990
    fg990
    Apr 7, 2023
    29
    @guoph 我用的是 Alfred 4 ,那应该是这个问题了。那我就先 0.5 用着吧,不折腾了。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2004 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 49ms · UTC 15:14 · PVG 23:14 · LAX 07:14 · JFK 10:14
    ♥ Do have faith in what you're doing.