TL;DR:
Need to run single server for Rasa/Duckling that supports multiple timezones as user input on /parse endpoint; is this possible?
$ curl -XPOST localhost:5000/parse -d '{"q":"tomorrow at eight", "tz": "US/Pacific"}'
{"value":"2018-10-16T08:00:00.000-04:00"}
$ curl -XPOST localhost:5000/parse -d '{"q":"tomorrow at eight", "tz": "US/Eastern"}'
{"value":"2018-10-16T08:00:00.000-07:00"}
LONG:
Installed the latest build but we are running into the same issue, we need to pass the timezone to Rasa and Rasa to pass it down to Duckling.
From what I experimented and read from the docs this is not possible, you can set the timezone in the Rasa/Duckling config but this is limiting the use of the Rasa server to one single timezone (eg. if you need to use Rasa for multiple timezones we would need to have at least one Rasa instance per timezone)
pipeline:
- name: "ner_duckling_http"
# url of the running duckling server
url: "http://localhost:8000"
# dimensions to extract
dimensions: ["time", "number", "amount-of-money", "distance"]
# allows you to configure the locale, by default the language is used
locale: "de_DE"
# if not set the default timezone of Duckling is going to be used
# needed to calculate dates from relative expressions like "tomorrow"
timezone: "Europe/Berlin"
What we would need is to have a single instance of Rasa that could take as input the timezone of the user and compute the date based on that, this is possible if Rasa would pass this on to Duckling, sample Duckling queries:
curl -XPOST http://0.0.0.0:8000/parse --data "locale=en_GB&text=tomorrow at eight&tz=US/Eastern&reftime=1539602179354"
[{"body":"tomorrow at eight","start":0,"value":{"values":[{"value":"2018-10-16T08:00:00.000-04:00","grain":"hour","type":"value"},{"value":"2018-10-16T20:00:00.000-04:00","grain":"hour","type":"value"}],"value":"2018-10-16T08:00:00.000-04:00","grain":"hour","type":"value"},"end":17,"dim":"time","latent":false}]
curl -XPOST http://0.0.0.0:8000/parse --data "locale=en_GB&text=tomorrow at eight&tz=US/Pacific&reftime=1539602179354"
[{"body":"tomorrow at eight","start":0,"value":{"values":[{"value":"2018-10-16T08:00:00.000-07:00","grain":"hour","type":"value"},{"value":"2018-10-16T20:00:00.000-07:00","grain":"hour","type":"value"}],"value":"2018-10-16T08:00:00.000-07:00","grain":"hour","type":"value"},"end":17,"dim":"time","latent":false}]