langchain icon indicating copy to clipboard operation
langchain copied to clipboard

Question: How to use datetime type with SelfQueryRetriever

Open wsantos opened this issue 1 year ago • 0 comments

Issue you'd like to raise.

How can one use SelfQueryRetriever to query datetime, I've added a datetime object as string to the metadata, not sure if that is right or if we should use timestamp, but things got weird with this prompt:

I want to watch a movie rated higher than 8.5 and released today
{
    "query": "",
    "filter": "and(gt(\"rating\", 8.5), eq(\"released\", \"today\"))"
}

I'm not sure how to instruct langchain to convert today to a datetime/str.

Is there a from/to AttributeInfo so we can convert when saving and loading from the vectorstore?

Long story short, how would you guys approach this scenario?

Thanks in advance.

Suggestion:

No response

wsantos avatar May 16 '23 17:05 wsantos