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

Fix max token length + GPT-4 #29

Closed

Conversation

CruelMoney
Copy link

Hey @abielzulio

Love the extension.

After a longer conversation I ran into an error, caused by hitting the token limit. This pull request attempts to fix this error.

A pretty naive implementation, but I think it's better than having to stop the conversation. It approximates the number of tokens by counting the words, and then removes old messages to stay under the limit (3750 tokens).

I've also added some other feats:

  • Fetch models from the API. This allows to use GPT-4 if enabled on the user's account.
  • Show the error message coming from OpenAI instead of the generic error message.

Let me know what you think.

@abielzulio
Copy link
Owner

abielzulio commented Mar 26, 2023

Hey @abielzulio

Love the extension.

After a longer conversation I ran into an error, caused by hitting the token limit. This pull request attempts to fix this error.

A pretty naive implementation, but I think it's better than having to stop the conversation. It approximates the number of tokens by counting the words, and then removes old messages to stay under the limit (3750 tokens).

I've also added some other feats:

  • Fetch models from the API. This allows to use GPT-4 if enabled on the user's account.

  • Show the error message coming from OpenAI instead of the generic error message.

Let me know what you think.

Hey! Thanks for your PR!

We’re actually one step closer to getting it published to the store (you can check my PR here: raycast/extensions#5253) and we already had some changes.

Could you open a PR from my raycast/extensions fork at https://github.com/abielzulio/extensions (branch: chatgpt/init)? So I can merge it into my existing PR

@abielzulio
Copy link
Owner

Merged! Thank you for your contribution @CruelMoney!

@abielzulio abielzulio closed this Mar 29, 2023
@CruelMoney
Copy link
Author

Thanks @abielzulio sorry, didn't have time to create a new pull request. Appreciate your work

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

2 participants