thefuck icon indicating copy to clipboard operation
thefuck copied to clipboard

Add ChatGPT as a rule, disabled by default.

Open XieGuochao opened this issue 1 year ago • 6 comments

This patch enhances thefuck by querying ChatGPT optionally. The user sets an environment variable THEFUCK_OPENAI_TOKEN from OpenAI to enable it.

Three new arguments are added:

  1. -c or --chatgpt: the number of suggestions from ChatGPT. If it is 0, ChatGPT is disabled.
  2. -t or --chatgpt-token: the maximum tokens for a ChatGPT query. By default, it is 100.
  3. -m or --chatgpt-model: the ChatGPT model used. By default, it is gpt-3.5-turbo.

XieGuochao avatar Mar 02 '23 16:03 XieGuochao

Fantastic PR

police merch (please merge!)

why not use OPENAI_TOKEN directly / as fallback?

pannous avatar Mar 04 '23 09:03 pannous

100 token default limits seems pretty low though?

pannous avatar Mar 04 '23 09:03 pannous

--chatgpt-token should be --chatgpt-max-tokens for clarity

--chatgpt-model can probably be removed since a new model will likely result in a new API

pannous avatar Mar 04 '23 09:03 pannous

Fantastic PR

police merch (please merge!)

why not use OPENAI_TOKEN directly / as fallback?

I was worrying users accidentally enabled it while one was using other OpenAI services. I am totally fine using OPENAI_TOKEN directly / as fallback.

100 token default limits seems pretty low though?

Great point! I am not a ChatGPT expert and can you suggest a better limit?

--chatgpt-token should be --chatgpt-max-tokens for clarity

Agree!

--chatgpt-model can probably be removed since a new model will likely result in a new API

I don't know if there would be GPT-4.0 or something similar with the same API but more data...

XieGuochao avatar Mar 04 '23 23:03 XieGuochao

This looks so promising to me. Like the idea. 🚀

xingjian-zhang avatar Apr 01 '23 18:04 xingjian-zhang

Status of this PR?

thibaultmol avatar Apr 28 '23 10:04 thibaultmol