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

AttributeError: 'Response' object has no attribute 'serialize' #554

Closed
thedp opened this issue Jan 4, 2017 · 5 comments
Closed

AttributeError: 'Response' object has no attribute 'serialize' #554

thedp opened this issue Jan 4, 2017 · 5 comments
Labels

Comments

@thedp
Copy link

thedp commented Jan 4, 2017

I'm getting this error when trying to talk to the bot over localhost:8000.
What am I missing? Thanks.

Internal Server Error: /api/chatterbot/
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/django/core/handlers/base.py", line 149, in get_response
    response = self.process_exception_by_middleware(e, request)
  File "/Library/Python/2.7/site-packages/django/core/handlers/base.py", line 147, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/Library/Python/2.7/site-packages/django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "/Library/Python/2.7/site-packages/django/views/generic/base.py", line 88, in dispatch
    return handler(request, *args, **kwargs)
  File "/Library/Python/2.7/site-packages/chatterbot/ext/django_chatterbot/views.py", line 68, in post
    response_data = response.serialize()
  File "/Library/Python/2.7/site-packages/chatterbot/ext/django_chatterbot/models.py", line 115, in serialize
    data['in_response_to'].append(response.serialize())
AttributeError: 'Response' object has no attribute 'serialize'
[04/Jan/2017 23:00:05] "POST /api/chatterbot/ HTTP/1.1" 500 14479
@vkosuri
Copy link
Collaborator

vkosuri commented Jan 5, 2017

which version of chatterbot are you using? To get current version, use this python -m chatterbot --version command on your terminal

@thedp
Copy link
Author

thedp commented Jan 5, 2017

I'm using the version from GitHub. Cloned yesterday.

@gunthercox
Copy link
Owner

Hi @thedp, I've pushed up a fix for this. The error message was correct in stating that the 'Response' object has no attribute 'serialize'.

@thedp
Copy link
Author

thedp commented Jan 8, 2017

@gunthercox thank you so much for this project and quick fix.
But I'm still getting this error. I've uninstalled the pip and reinstalled it.
I'm trying to run the example django_app. Am I doing something wrong to trigger this?

Thank you.

P.S pip shows it's 0.5.4

EDIT: I've just tested by cloning the project and the error is gone.

@gunthercox
Copy link
Owner

Ok, I'm glad your issue was resolved. The fix will be available through pip once I release the next version. For now it just exists in the latest changes on GitHub.

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

No branches or pull requests

3 participants