langchain
langchain copied to clipboard
fix: remove empty lines that cause InvalidRequestError
remove empty lines in GenerativeAgentMemory that cause InvalidRequestError in OpenAIEmbeddings
Let's say the text given to GenerativeAgent._parse_list is
text = """
Insight 1: <insight 1>
Insight 2: <insight 2>
"""
This creates an openai.error.InvalidRequestError: [''] is not valid under any of the given schemas - 'input' because GenerativeAgent.add_memory() tries to add an empty string to the vectorstore.
This PR fixes the issue by removing the empty line between Insight 1 and Insight 2
Before submitting
Who can review?
Community members can review the PR once tests pass. Tag maintainers/contributors who might be interested:
@hwchase17 @vowelparrot @dev2049