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

Unable to use TemplatedNaturalLanguageGenerator in NLG due to Sanic/uvicorn conflict #4140

Closed
moaazsidat opened this issue Jul 30, 2019 · 6 comments

Comments

@moaazsidat
Copy link
Contributor

moaazsidat commented Jul 30, 2019

Does it make more sense to put TemplatedNaturalLanguageGenerator as part of rasa_sdk instead of rasa.core.nlg, since it is used like so:
https://github.com/RasaHQ/rasa/blob/master/examples/nlg_server/nlg_server.py#L57

The reason being that we're using something other than Sanic for our NLG server and are running into conflicting dependencies when trying to install rasa with the latest uvicorn installation due to the following Sanic/uvicorn incompatibility:
sanic-org/sanic#1629

Anyone with more knowledge of how rasa works internally comment on if this be relatively easily extracted to be part of rasa_sdk?
https://github.com/RasaHQ/rasa/tree/master/rasa/core/nlg

Or alternatively, should there be a rasa_nlg package?

@moaazsidat moaazsidat added the type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. label Jul 30, 2019
@msamogh
Copy link
Contributor

msamogh commented Jul 31, 2019

Thanks for raising this issue, @ricwo will get back to you about it soon.

@ricwo
Copy link
Contributor

ricwo commented Aug 2, 2019

Hi @moaazsidat,

The reason being that we're using something other than Sanic for our NLG server and are running into conflicting dependencies when trying to install rasa with the latest uvicorn installation due to the following Sanic/uvicorn incompatibility

I'm confused about this issue, since the built-in NLG server in rasa-sdk uses flask. Where are you running into the issue? Isn't simply running python -m rasa_sdk --actions actions.py an option for you, which would not require a sanic installation?

The NLG module is used extensively in the rasa.core module, and rasa-sdk is in general not a dependency of rasa (an installation is only required for running the custom action server out of rasa). It sounds like a fix is being worked on for sanic 19.9: sanic-org/sanic#1629 (comment)

@moaazsidat
Copy link
Contributor Author

We're using our own NLG service that's built using FastAPI and Uvicorn. It's just a web service that given an utterance, returns the template as json.

We want to return TemplatedNaturalLanguageGenerator as the response so that the templates returned by this NLG service can be filled in with slot values as they're being returned (since TemplatedNaturalLanguageGenerator let's us do that)

The limitation right now is that we have to install the entire rasa package to our NLG service, just to access TemplatedNaturalLanguageGenerator, but installing rasa also installs Sanic which then conflicts with Uvicorn.

Regardless of how Sanic resolves this, I still think it highlights a need to separate rasa.core.nlg into a separate package because it should be able to be used in any pythonic web service.

Let me know if that makes sense, happy to elaborate further.

@ricwo ricwo removed the type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. label Aug 4, 2019
@ricwo
Copy link
Contributor

ricwo commented Aug 4, 2019

You'd still require an installation of rasa, even if rasa.core.nlg were its own package (it needs the Domain and EndpointConfig for example).

As a temporary solution until Sanic fixes the issue, can you just install rasa without Sanic for your Uvicorn webservice? I mean just cloning the repository and removing Sanic from setup.py and requirements.txt

@moaazsidat
Copy link
Contributor Author

hmm, fair enough, yeah, had a feeling that it may be less trivial to extract it into a lib.

@akelad
Copy link
Contributor

akelad commented Aug 15, 2019

@ricwo can this be closed?

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

4 participants