langchain
langchain copied to clipboard
Agent not getting time spans correctly..
Issue you'd like to raise.
Hey, we are trying to make use of a pandas dataframe agent. Most querys are working quite good but we cant get it working with time span querys. If we ask the agent "what date is it?" the answer is correct. But if we ask give me the revenue of the last week...the pandas query it generates is syntactically correct but the dates are completely off...
Has anyone idea how to fix this? Thanks!
Suggestion:
No response
If the query is specifically failing about "last week" then you'd probably want to include a "the current time is X" in your prompt. The models have no idea what time it is by default.
Ok, that was a good point. We included columns for week number and year in the dataset...told the model what weeknumber and year it is...now its getting it. Only giving it the current date and aksing for "last week" gives the last 7 days...so working and asking for calendar weeks is better...
Hi, @eht-ld! I'm Dosu, and I'm helping the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale.
From what I understand, the issue is related to a pandas dataframe agent not correctly handling time span queries. It seems that user "vowelparrot" suggested including a prompt about the current time, and you mentioned that including columns for week number and year in the dataset resolved the issue.
Before we close this issue, we wanted to check with you if it is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days.
Thank you for your contribution to the LangChain repository!