Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ChatGPT as a rule, disabled by default. #1363

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

XieGuochao
Copy link

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.

@pannous
Copy link

pannous commented Mar 4, 2023

Fantastic PR

police merch (please merge!)

why not use OPENAI_TOKEN directly / as fallback?

@pannous
Copy link

pannous commented Mar 4, 2023

100 token default limits seems pretty low though?

@pannous
Copy link

pannous commented Mar 4, 2023

--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

@XieGuochao
Copy link
Author

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...

@xingjian-zhang
Copy link

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

@thibaultmol
Copy link

Status of this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants