cleverbit
cleverbit4mo ago

cleverbit - Not sure where to ask this, but I w...

Not sure where to ask this, but I want to ask my OpenAI Assistant node to do some date-based things (eg. "Remind me tomorrow") but it thinks the date is December 2023. My workaround for this is to calculate the current date as part of the prompt (Date.now() + prompt) — but this means each prompt is essentially using tokens to pass the date, even when it's not relevant. Is there a better way to go about this?
4 Replies
Chris Wright | Brandmember
I've only my rudimentary understanding of this but using AI for dates seems unnecessary, particularly if you are using reminders you want the day to be precise so surely it is better to structure it in data and display it in the front end. I can think of exactly how I would build this with logic in Bubble. If you must do this is there some way to fetch the current date in the node logic before adding the prompt?
cleverbit
cleverbit4mo ago
Hey thanks for the reply. Yeah I have sort of "hacked" it in by adding Date.now() as a prefix to the prompt — so that is working. But like I said, I'm not sure if there's a better way to handle this, as it feels a bit hacky? In this case, I need my LLM to process dates, because if the user says something like "Remind me tomorrow" then it needs to output a date (which it is already set up to do, with tools, etc.). The problem I was seeing was just that it would base its logic on thinking the current date was Dec 2023. The strange thing is, now if I ask Chat GPT (in the regular chat interface) "what time is it", I can see that it does call one of it's tools, because it says "Analyzing…" and then comes back with the correct UTC time. But when I ask an Assistant that, it does not.
Chris Wright | Brandmember
What functions have you set on the assistant... Something like this?....
No description
cleverbit
cleverbit4mo ago
No, that function would have to sit outside the assistant, so that the assistant can call it. I’ve injected the date in the OpenAI node itself in buildship- where the Query.prompt variable is, I’ve modified it to include the date: "Current time: " + (new Date().toISOString()) + ", User prompt: " + ctx["root"]["request"]["query"].prompt I’m just wondering if there’s a better way, better place to put this.