-
I am having a heck of a time getting Semantic Kernel (or my code) to work the same way every time when dealing with dates. I have a chat bot that looks up data from my database and returns answers to questions that are asked. Its a react website using endpoints so we send a copy of the history to the endpoint every time to keep the history of the chat available for the bot. Endpoint code. namespace HealthLog.Server.EndPoints.LLM; // ReSharper disable once UnusedMember.Global
}` When the bot opens if i ask it did i drink coffee today if calls function get drinks and passes the date time in utc to the function. When it gets to the function its in local (which is strange) so we convert it back to utc and everything is good. Function GetDrinks invoking. Function Code Here
}` This returns what is expected. The issue is if I ask What about yesterday it changes the call to the function to no longer be dealing with the full date and changes the time. Microsoft.SemanticKernel.KernelFunction[0]
How can i get it to do the same thing each time? Note: I send the current date as part of the system message every time because I had a get date function and sometimes it would call it and other times i would guess and think it was next month or 2023. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can use a function call that gets the current time/date and pass that over to the LLM for function calling vs doing this in a system message. And maybe even a second one for +/- days. You can also pass JSON to the model in the format that you want on the way out ( in the Kernel function description). |
Beta Was this translation helpful? Give feedback.
You can use a function call that gets the current time/date and pass that over to the LLM for function calling vs doing this in a system message. And maybe even a second one for +/- days. You can also pass JSON to the model in the format that you want on the way out ( in the Kernel function description).
See if that will work for you.