langchain-ai / langchain-postgres

LangChain abstractions backed by Postgres Backend

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Could you clarify why the "contains" operator is not implemented?

artefactop opened this issue · comments

Hi, we want to migrate from langchain_community and we are using the "contains" operator but is not implemented here.

Is there any reason?
If not, do you have plan to implement it?

The community implementation consists of two implementations:

  1. one that uses a JSON field -- this is the version that has contains operator. This version is also buggy as it casts things into text.
  2. I wrote a second implementation using a JSONB field that addresses most of the implementation issues. But it doesn't have a $contains operator.

You're free to contribute functionality for this!

What I'd be looking for are clear semantics for how the operator works together with complete test cases.

Possible types are for the field: None, str, float, int, List[float], List[int], List[str]

You can reference this recent PR to see how to go about doing that: #40

Thanks @eyurtsev ! We'll definitely take a look at reviewing the implementation details you provided.