Open PabloVD opened 4 weeks ago
The KeyError: 'data' in the issue occurs due to a 429 Too Many Requests response, which prevents some documents from being processed and results in payloads that lack the data key. To reveal the actual error and improve clarity, I propose adding a check with raise_for_status() to handle cases where the status code is not 200. This will ensure that the code only attempts to access the data key when the response is successful.
@jamesev15 please see my PR. I have implemented a simple retrying mechanism to account for this, rather than just raising the error which works.
Sure! I like your approach
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
Description
Ì'm trying to create MistralAI embeddings from a pdf document but I get the mentioned error. Are there flags or parameters of
RecursiveCharacterTextSplitter
orMistralAIEmbeddings
which could avoid such issue? Thanks in advance,System Info
System Information
Package Information
Optional packages not installed
Other Dependencies