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

Minor restructuring for response creation #1810

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

domanchi
Copy link

@domanchi domanchi commented Sep 7, 2019

Background Context

In my own use of this library, I structured it such that individual LogicAdapters are able to specify certain response styles, based on certain criteria. I do this by attaching additional information through the Statement object, which is passed around in a variety of functions.

Issue

generate_response in the ChatBot class overrides the resulting Statement object.

Proposed Fix

By breaking it up into a separate function, we keep the original function cleaner, as well as allows customization of the flow through polymorphism. Otherwise, we would need to duplicate a large chunk of code (the original generate_response), and this would lead to future maintenance problems down the road.

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

Successfully merging this pull request may close these issues.

1 participant