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

Refactor Discord bot logic to split response messages in paragraphs #113

Merged
merged 2 commits into from
Oct 28, 2024

Conversation

LuchoAravena
Copy link
Collaborator

@LuchoAravena LuchoAravena commented Oct 25, 2024

On this PR a new logic was implemented to split OpenAI image review response into paragraphs to avoid Discord API error with characters. ({"message": {"code": 50035, "errors": {"content": {"_errors": [{"code": "BASE_TYPE_MAX_LENGTH", "message": "Must be 2000 or fewer in length."}]}}, "message": "Invalid Form Body"}, "status_code": 400})

Now:

  • The OpenAI image review response generates review key with --DIVISION-- word, so that afterward,
  • Discord Utils splits every two paragraphs with --DIVISION-- and sends each split to private message, avoiding the Discord API error

Closes #112

@LuchoAravena LuchoAravena added the 🐞 Bug Something isn't working label Oct 25, 2024
@LuchoAravena LuchoAravena self-assigned this Oct 25, 2024
@coveralls
Copy link

coveralls commented Oct 25, 2024

Pull Request Test Coverage Report for Build 11558960652

Details

  • 16 of 16 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 99.621%

Totals Coverage Status
Change from base Build 11244485946: 0.03%
Covered Lines: 3417
Relevant Lines: 3430

💛 - Coveralls

Copy link
Collaborator

@FelipeGuzmanSierra FelipeGuzmanSierra left a comment

Choose a reason for hiding this comment

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

Great! 🚀

@LuchoAravena LuchoAravena merged commit 589d3ab into main Oct 28, 2024
4 checks passed
@LuchoAravena LuchoAravena deleted the fix-response-length-limitations branch October 28, 2024 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix response length limitations
3 participants