fossasia / susi_server

SUSI.AI server backend - the Artificial Intelligence server for personal assistants https://susi.ai
GNU Lesser General Public License v2.1
2.5k stars 1.08k forks source link

Add public transit to Susi AI #113

Closed Fluepke closed 7 years ago

Fluepke commented 7 years ago

Many public transit providers have open data portals offering realtime data. (E.g. for Berlin see this). We should access this data directly or via a wrapper service to provide Susi users information about different means of transportation Maybe the sourcecode from transportr could be used to achieve this, especially enabler

Fluepke commented 7 years ago

@mariobehling suggested to implement this skill via dream.asksusi.com This would require to have an external API, that can provide the necessary data. Another idea would be to implement this via a ConsoleService, but it might be problematic to include and distribute the necessary API keys.

mariobehling commented 7 years ago

@Fluepke Let's do the lightweight approach first. "dream.asksusi.com" is not intended to be a way for implementation. The idea is to provide a setting to write skills and test them right away. Currently skills need to be added to the repository. We are planning to provide an easier way, but this is out of scope of this issue.

We really need developers to write skills and understand the flow. So, for the moment using external APIs is the best approach and it moves the project further a lot. Please proceed.

sudheesh001 commented 7 years ago

@Fluepke This definitely sounds like an interesting thing to do. The intention with susi is that others who might want to use this data can also integrate it. We can always use a whitelisted IP Address of the server to ensure that the API can be used between susi and the required service by distributing and installing a key on the servers but the intention is to work with open data.

Providing API ingestion interfaces is definitely something that needs to be implemented into susi server but for starters we can always implement this as a susi dream or a consoleService and use the conf to store the API credentials or we could as well build an API manager.

Orbiter commented 7 years ago

This issue shows that one of the core requirements for a public storage place must be a concept to hide application keys. I added that idea to https://github.com/fossasia/susi_server/issues/106#issuecomment-294828643

Fluepke commented 7 years ago

Ok, so I've tinkered around with enabler. It's working quite well and for Berlin / Brandenburg it does not require any API keys as it just parses a public available interface (is this legal)? Whats the way to go for implementing a ConsoleService for this? Just copy the necessary code from enabler (while contributing the authors) and writing a ConsoleService to interface with enabler?

Another option would be to deploy enabler with all API keys to a private server. One could access this server from Susi. But I'd prefer a solution that does not depend from somebody running a service on his server.

What do you think?

Fluepke commented 7 years ago

We can include transport-enabler as a git submodule and add it to the build chain. However there were some arguments against git submodules. What's your opinion towards this? If it's ok, I would write a proper PR for this (not that hacky one from a hackathon)

sudheesh001 commented 7 years ago

It's working quite well and for Berlin / Brandenburg it does not require any API keys as it just parses a public available interface (is this legal)?

As long as it's published online for webscrapers and crawlers to index it, it's fine storing it and doing anything we want with it.

I don't really like the idea of having git-submodules in the repository, it causes a huge dependency and lots of problems for new comers. For now I would really like the second approach to have the enabler on a private server and someone running it as a service from there. We can then replicate and host the enabler ourselves on the production servers.

Fluepke commented 7 years ago

Of course, we could host transportr-enabler, however hosting stuff on our own requires us to keep it all running and to maintain it.

Downsides of hosting transportr-enabler:

On the other, submodules definitely come at a cost as well: