-
Notifications
You must be signed in to change notification settings - Fork 216
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: Added fix to encode documents within rolling window #256
Conversation
…)> 2048 openai limit
Failed to generate code suggestions for PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mesax1 looks good to me, just some checks are failing
This reverts commit 7bb47b3efa90c8ea21b7ac756158a7f70f4bc04d.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #256 +/- ##
==========================================
+ Coverage 80.78% 80.95% +0.16%
==========================================
Files 44 44
Lines 2389 2399 +10
==========================================
+ Hits 1930 1942 +12
+ Misses 459 457 -2 ☔ View full report in Codecov by Sentry. |
fix: BadRequestError: Error code: 400 - {'error': {'message': "'$.input' is invalid. Please check the API reference: https://platform.openai.com/docs/api-reference.", 'type': 'invalid_request_error', 'param': None, 'code': None}}
Occurs when _encode_documents attempts to run splitter(docs), and len(docs)>2048, as it's an OpenAI limit when generating embeddings of an array.
How it fixes the problem:
Split the array into multiple arrays when len(docs)>2000, and sends the multiple arrays to generate the embeddings.