chatgraph 0.2.0__py3-none-any.whl → 0.2.2__py3-none-any.whl

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.

@@ -113,8 +113,8 @@ class ChatbotApp(ABC):
113
113
  Returns:
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
- customer_id = message.customer_id
117
-
116
+ customer_id = message.user_state.customer_id
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
  Metadata-Version: 2.1
2
2
  Name: chatgraph
3
- Version: 0.2.0
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
@@ -1,6 +1,6 @@
1
1
  chatgraph/__init__.py,sha256=6pDNMUOLR8iFK_3mWula1IJQcIoE8io-65mS_QheXXE,642
2
2
  chatgraph/auth/credentials.py,sha256=xsMEpLQnc66novPjL6upocMcnUnvFJ7yxINzUenkxmc,2388
3
- chatgraph/bot/chatbot_model.py,sha256=cy_IzeM8rZps9LxPKvEm9EWBQ_DlMBRm7iViQCxYy7s,6095
3
+ chatgraph/bot/chatbot_model.py,sha256=GJ36-AlRdoWUoZpUmePHCo2NucyaD7milyWlMBukb-E,6461
4
4
  chatgraph/bot/chatbot_router.py,sha256=kZ_4X5AhhE2mntx4tcHiapaSKC1T4K1jqIVjLp1Pjg0,2817
5
5
  chatgraph/error/chatbot_error.py,sha256=4sEcW8vz0eQk2QDmDygucVM4caHliZW5iH7XJvmLBuk,1897
6
6
  chatgraph/error/route_error.py,sha256=CY8m82ap7-Sr-DXPsolltRW50TqD__5RyXBmNNJCWr8,793
@@ -11,7 +11,7 @@ chatgraph/types/message_types.py,sha256=7eB45hrlbYKV1Lp9vysR6V7OXNsySpeKYbGBc2Ux
11
11
  chatgraph/types/output_state.py,sha256=fpJ_hGO4aZ3wr6DV4i9ctnkHytWhK6ZDpKpJ3vSwRyY,3064
12
12
  chatgraph/types/route.py,sha256=nKTqzwGl7d_Bu8G6Sr0EmmhuuiZWKEoSozITRrdyi1g,2587
13
13
  chatgraph/types/user_state.py,sha256=nliV-kC_yOmYoFh8CQSfT92DbOv4BLF0vvn8kotnDog,2884
14
- chatgraph-0.2.0.dist-info/LICENSE,sha256=rVJozpRzDlplOpvI8A1GvmfVS0ReYdZvMWc1j2jV0v8,1090
15
- chatgraph-0.2.0.dist-info/METADATA,sha256=QCo3qrEPo-qPcxIekYUq5jkt-8pgKoDI2Xzp_gASERM,5829
16
- chatgraph-0.2.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
17
- chatgraph-0.2.0.dist-info/RECORD,,
14
+ chatgraph-0.2.2.dist-info/LICENSE,sha256=rVJozpRzDlplOpvI8A1GvmfVS0ReYdZvMWc1j2jV0v8,1090
15
+ chatgraph-0.2.2.dist-info/METADATA,sha256=o9GMFxAwlbTfQ6g_u47f2DjAfp4eixfzLaHA1xRoavM,5829
16
+ chatgraph-0.2.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
17
+ chatgraph-0.2.2.dist-info/RECORD,,