raptor
raptor copied to clipboard
Bug in chunk splitting
I have been struggling with method RA.add_documents() with Azure OpenAI since it returned: Error: 400 ‘$.input’ is invalid. I found the problem was due to split_text() function in utils.py since it, in some situations, could return empty chunk which would give error when sent to openai. To fix this, I just added the following line of code: chunks = [chunk for chunk in chunks if chunk.strip()] in build_from_text method of tree_builder.py