What is the equivalent of Google's Dialogflow's `@sys.date-period` if you're using Actions Console?

64 Views Asked by At

I'm struggling to come to grips with the differences in Google's natural language processing tools. It seems Dialogflow was the original purchase but now Google appears to be egging people on to the "Actions Console". I'm not even sure if this is a correct statement because the internet is littered with so many different Google tools and one never quite knows which one is current, recommended, or perhaps deprecated.

Anyhow, my concern is how to get "date intervals". For example, my application wants to say:

"How much money did I spend on fuel in December?"

by implication I need a start date and an end date.

In Google's Dialowflow's lingo it appears we are fishing for a System Entity, Date and Time, called @sys.date.date-period. This matches a date interval. This is perfect for my use-case, yet from what I understand Dialogflow is outdated.

In contrast the modern "modern" tool called Actions on Google or something by that name has this concept a conversational type variable called actions.type.DateTime

In contrast to Dialogflow, Actions on Google seems highly limited. A screenshot of the system types are below:

enter image description here

What am I missing? Are the tools just so different and I should rather be using Dialogflow? Is "Actions on Google" just so new that I started with the wrong tool? Any way of migrating from "Actions on Google" to Dialogflow, or is this a one way street?

I started coding this in PHP but I see I'm going down a serious rabbit hole and would rather use built-in types than re-invent the wheel. Code snippet:

list($start, $end, $message) = match ($interval) {            
            'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'
            => $this->processMonth($date, $interval),
            'last-week', 'the-last-week'            
            => $this->processWeeks($date, $interval, 1),
            'two-weeks-ago'            
            => $this->processWeeks($date, $interval, 1),
            'the-last-2-weeks'            
            => $this->processWeeks($date, $interval, 2),
            'last-month', 'the-last-month'
            => Carbon::createFromFormat('Y-m-d', $date)->addMonths(1)->format('Y-m-d'),
            'last-two-months'
            => Carbon::createFromFormat('Y-m-d', $date)->addMonths(2)->format('Y-m-d'),
            default => now(),
        };
0

There are 0 best solutions below