mirror of
https://github.com/langchain-ai/langchain-postgres.git
synced 2026-07-16 01:33:18 -04:00
ValidationError: 1 validation error for Document metadata Input should be a valid dictionary #44
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @arthberman on GitHub (Sep 18, 2024).
Since LangChain 0.3 and within LangGraph Studio container, have the following error :
ValidationError: 1 validation error for Document metadata Input should be a valid dictionary [type=dict_type, input_value=Fragment(buf=b'{"name": "...name"}'), input_type=Fragment] For further information visit https://errors.pydantic.dev/2.9/v/dict_typeWhen running the following query :
It happens when running vector_store.similarity_search query with metadata filters.
Seems to be linked to switch to Pydantic V2?
@arthberman commented on GitHub (Sep 18, 2024):
pyproject.toml
`[project]
name = ""
version = "0.0.1"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"python-dotenv>=1.0.1",
"langchain>=0.3.0",
"langchain-community>=0.3.0",
"langchainhub>=0.1.21",
"langchain-anthropic>=0.2.1",
"langchain-groq>=0.2.0",
"langchain-core>=0.3.1",
"langgraph>=0.2.22",
"langchain-openai>=0.2.0",
"pydantic>=2.9.2",
"temporalio>=1.7.1",
"toml>=0.10.2",
"packaging>=24.1",
"ipykernel>=6.29.5",
"langgraph-checkpoint-postgres>=1.0.7",
"langgraph-sdk>=0.1.30",
"langchain-postgres>=0.0.12",
"psycopg2-binary>=2.9.9",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.uv]
dev-dependencies = ["ipykernel>=6.29.5"]
[tool.hatch.build.targets.wheel]
packages = ["src/app", "src/parser", "src/utils"]
`