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

Question regarding reading request body message #1

Open
JasonCLEI opened this issue Mar 22, 2019 · 1 comment
Open

Question regarding reading request body message #1

JasonCLEI opened this issue Mar 22, 2019 · 1 comment

Comments

@JasonCLEI
Copy link

Hello, Why response = predictor.reply(str(request.json['message'])) got an error TypeError: 'NoneType' object is not subscriptable? Thank you?

@meck93
Copy link
Owner

meck93 commented Mar 22, 2019

Hi @JasonCLEI

Have you made sure that the python endpoint /prediction is receiving a post request containing a body object that looks like this: {body: { message: received_message.text }}.

What response = predictor.reply(str(request.json['message'])) does is:

  • it converts the message from the body to a string
  • inputs the message to the pre-trained model and generates the response

@meck93 meck93 changed the title Question Question regarding reading request body message Mar 22, 2019
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