chatgraph 0.2.1__tar.gz → 0.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of chatgraph might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: chatgraph
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: A user-friendly chatbot library
5
5
  Home-page: https://github.com/irissonnlima/chatgraph
6
6
  License: MIT
@@ -114,7 +114,7 @@ class ChatbotApp(ABC):
114
114
  str: A resposta gerada pela função da rota, que pode ser uma mensagem ou o resultado de uma redireção.
115
115
  """
116
116
  customer_id = message.user_state.customer_id
117
-
117
+ user_state = message.user_state
118
118
  menu = message.user_state.menu
119
119
  menu = menu.lower()
120
120
  handler = self.__routes.get(menu, None)
@@ -138,8 +138,16 @@ class ChatbotApp(ABC):
138
138
  if type(message_response) in (str, float, int):
139
139
  response = ChatbotResponse(message_response)
140
140
  return response.json()
141
+ elif type(message_response) == ChatbotResponse:
142
+ route = self.__adjust_route(message_response.route, menu)
143
+ response = message_response.json()
144
+ response['user_state'] = {
145
+ 'customer_id': customer_id,
146
+ 'menu': route,
147
+ 'obs': user_state.obs,
148
+ }
149
+ return response
141
150
  elif type(message_response) in (ChatbotResponse, EndChatResponse, TransferToHuman):
142
- # route = self.__adjust_route(message_response.route, menu)
143
151
  return message_response.json()
144
152
  elif type(message_response) == RedirectResponse:
145
153
  route = self.__adjust_route(message_response.route, menu)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "chatgraph"
3
- version = "0.2.1"
3
+ version = "0.2.2"
4
4
  description = "A user-friendly chatbot library"
5
5
  authors = ["Irisson N. Lima <irisson.lima@verdecard.com.br>"]
6
6
  readme = "README.md"
File without changes
File without changes