Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SUSI Server ignores time zone information #1435

Open
norbusan opened this issue Jan 12, 2020 · 4 comments
Open

SUSI Server ignores time zone information #1435

norbusan opened this issue Jan 12, 2020 · 4 comments

Comments

@norbusan
Copy link
Member

Actual Behaviour

Asking the time of susi server returns the time in GMT instead of local time, ignoring various information.

Example code:

import susi_python as susi
import requests
susi.ask("what is the time")
{'planned_actions': [], 'answer': 'it is 12 minutes past 8'}
# actual time is 16:08
# send request with parameters is
# https://api.susi.ai/susi/chat.json
# {'q': 'what is the time', 'timezoneOffset': -540, 'device_type': 'Smart Speaker'}

# now try to set location and send additional geo data, too
res = requests.get('http://ip-api.com/json').json()
susi.update_location(longitude=res['lon'], latitude=res['lat'],country_name=res['country'], country_code=res['countryCode'])
{'planned_actions': [], 'answer': 'it is 12 minutes past 8'}
# actual time is 16:08
# send request with parameters is
# https://api.susi.ai/susi/chat.json
# {'q': 'what is the time', 'timezoneOffset': -540, 'device_type': 'Smart Speaker', 'latitude': 36.4002, 'longitude': 136.4757, 'country_name': 'Japan', 'country_code': 'JP'}

Thus, susi server ignores

  • timezoneOffset
  • latitude and longitude
  • country_name and country_code

Expected Behaviour

I expect SUSI server to answer in local time.

@norbusan
Copy link
Member Author

Digging through the source code, I see that the timezoneOffset and other infos are added to the recall, but never evaluated for normal answers. The only place where the timezoneOffset plays a role is in the planned action section, but for things like "what is the time" it is not used.

@parikshitgupta1
Copy link
Member

Why does Susi server ignores
country_name and country_code
#issue

@norbusan
Copy link
Member Author

Where should this play a role? But yes, the country etc should be evaluated under certain skills, I agree.

@parikshitgupta1
Copy link
Member

I see

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants