Our recommendation is to write a date components like struct that is Generable and contains only the date components you care about. make the model generate that struct, and then manually convert it into a date object.
You might have something like this:
@Generable struct Arguments {
var startDate: CalendarDateComponents?
var endDate: CalendarDateComponents?
}
@Generable struct CalendarDateComponents {
var year: Int
var month: Int
var day: Int
}
When prompting, make sure to tell the model the current date.
Topic:
Machine Learning & AI
SubTopic:
Foundation Models