"""Go API action dispatcher for dialogue conversations."""

from go.api.go_api.action_dispatcher import ConversationActionDispatcher


class DialogueActionDispatcher(ConversationActionDispatcher):
    def handle_get_poll(self, conv):
        pass

    def handle_save_poll(self, conv, poll):
        pass

"""Go API action dispatcher for dialogue conversations."""

from go.api.go_api.action_dispatcher import ConversationActionDispatcher


class DialogueActionDispatcher(ConversationActionDispatcher):
    def handle_get_poll(self, conv):
        return {"poll": conv.config.get("poll")}

    def handle_save_poll(self, conv, poll):
        conv.config["poll"] = poll
        d = conv.save()
        d.addCallback(lambda r: {"saved": True})
        return d

Implement poll saving and getting.
Implement poll saving and getting.

  """Go API action dispatcher for dialogue conversations."""
  
  from go.api.go_api.action_dispatcher import ConversationActionDispatcher
  
  
  class DialogueActionDispatcher(ConversationActionDispatcher):
      def handle_get_poll(self, conv):
-         pass
+         return {"poll": conv.config.get("poll")}
  
      def handle_save_poll(self, conv, poll):
-         pass
+         conv.config["poll"] = poll
+         d = conv.save()
+         d.addCallback(lambda r: {"saved": True})
+         return d
  
Implement poll saving and getting.
## Code Before:
"""Go API action dispatcher for dialogue conversations."""

from go.api.go_api.action_dispatcher import ConversationActionDispatcher


class DialogueActionDispatcher(ConversationActionDispatcher):
    def handle_get_poll(self, conv):
        pass

    def handle_save_poll(self, conv, poll):
        pass

## Instruction:
Implement poll saving and getting.
## Code After:
"""Go API action dispatcher for dialogue conversations."""

from go.api.go_api.action_dispatcher import ConversationActionDispatcher


class DialogueActionDispatcher(ConversationActionDispatcher):
    def handle_get_poll(self, conv):
        return {"poll": conv.config.get("poll")}

    def handle_save_poll(self, conv, poll):
        conv.config["poll"] = poll
        d = conv.save()
        d.addCallback(lambda r: {"saved": True})
        return d
