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: handle repetitive prompt patterns OpenAI error #49

Merged
merged 1 commit into from
Jan 20, 2024

Conversation

Patai5
Copy link
Contributor

@Patai5 Patai5 commented Jan 20, 2024

fixes issues opened by some users:
https://console.apify.com/actors/paOtbjvyUiNsr1Qms/issues/weHU20mzDyo4acWxN
https://console.apify.com/actors/paOtbjvyUiNsr1Qms/issues/8LbRwYD6M76m2RiVu


This error is not documented in the OpenAI errors and there are only a few instances of it on the internet.
Basically OpenAI is trying to save credits of programmers who use repetitive and useless tokens in their inputs, i.e. wasting their prompt token usage.
Unfortunately there doesn't seems to be any way to disable this... we simply have to skip GPT processing for requests that get this response.
Ultimately our users will have to identify what is repetitive on webpages they are trying to scrape and remove those elements using removeElementsCssSelector input option.

@Patai5 Patai5 merged commit 6cdc8af into master Jan 20, 2024
1 check passed
@Patai5 Patai5 deleted the fix-handle-openai-repetitive-patterns-error branch January 20, 2024 23:00
Copy link
Contributor

@metalwarrior665 metalwarrior665 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Let's see how the users will respond to this. To be honest, I could see leaving the previous behavior as well since it will often happen on big part of the scraped domain so we could be running quite a lot of blank pages. Let's see

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.

2 participants