LangSmith Log Anomaly: ValidationError none is not an allowed value
Closed this issue · 0 comments
davidgxue commented
Describe the bug
Saw recurrence of the error ValidationError none is not an allowed value after 0.2.0 release.
Example Log
ValidationError(model='Document', errors=[{'loc': ('page_content',), 'msg': 'none is not an allowed value', 'type': 'type_error.none.not_allowed'}])Traceback (most recent call last):
File "/app/.venv/lib/python3.11/site-packages/langchain/chains/base.py", line 306, in __call__
self._call(inputs, run_manager=run_manager)
File "/app/.venv/lib/python3.11/site-packages/langchain/chains/conversational_retrieval/base.py", line 155, in _call
docs = self._get_docs(new_question, inputs, run_manager=_run_manager)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.11/site-packages/langchain/chains/conversational_retrieval/base.py", line 317, in _get_docs
docs = self.retriever.get_relevant_documents(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.11/site-packages/langchain_core/retrievers.py", line 211, in get_relevant_documents
raise e
File "/app/.venv/lib/python3.11/site-packages/langchain_core/retrievers.py", line 204, in get_relevant_documents
result = self._get_relevant_documents(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.11/site-packages/langchain/retrievers/contextual_compression.py", line 44, in _get_relevant_documents
docs = self.base_retriever.get_relevant_documents(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.11/site-packages/langchain_core/retrievers.py", line 211, in get_relevant_documents
raise e
File "/app/.venv/lib/python3.11/site-packages/langchain_core/retrievers.py", line 204, in get_relevant_documents
result = self._get_relevant_documents(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.11/site-packages/langchain/retrievers/contextual_compression.py", line 44, in _get_relevant_documents
docs = self.base_retriever.get_relevant_documents(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.11/site-packages/langchain_core/retrievers.py", line 211, in get_relevant_documents
raise e
File "/app/.venv/lib/python3.11/site-packages/langchain_core/retrievers.py", line 204, in get_relevant_documents
result = self._get_relevant_documents(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.11/site-packages/langchain/retrievers/multi_query.py", line 175, in _get_relevant_documents
documents = self.retrieve_documents(queries, run_manager)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.11/site-packages/langchain/retrievers/multi_query.py", line 210, in retrieve_documents
docs = self.retriever.get_relevant_documents(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.11/site-packages/langchain_core/retrievers.py", line 211, in get_relevant_documents
raise e
File "/app/.venv/lib/python3.11/site-packages/langchain_core/retrievers.py", line 204, in get_relevant_documents
result = self._get_relevant_documents(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.11/site-packages/langchain_community/retrievers/weaviate_hybrid_search.py", line 161, in _get_relevant_documents
docs.append(Document(page_content=text, metadata=res))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.11/site-packages/langchain_core/load/serializable.py", line 107, in __init__
super().__init__(**kwargs)
File "/app/.venv/lib/python3.11/site-packages/pydantic/v1/main.py", line 341, in __init__
raise validation_error
pydantic.v1.error_wrappers.ValidationError: 1 validation error for Document
page_content
none is not an allowed value (type=type_error.none.not_allowed)
Expected behavior
Should not error out