Skip to content

ValidationError: 1 validation error for Document metadata Input should be a valid dictionary #118

Open
@arthberman

Description

@arthberman

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_type
When running the following query :

results = self.vector_store.similarity_search(
            query=name,
            k=1,
            filter={"id": {"$eq": id}, "name": {"$eq": name}},
)

It happens when running vector_store.similarity_search query with metadata filters.
Seems to be linked to switch to Pydantic V2?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions