chatgraph 0.2.0__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.
- {chatgraph-0.2.0 → chatgraph-0.2.2}/PKG-INFO +1 -1
- {chatgraph-0.2.0 → chatgraph-0.2.2}/chatgraph/bot/chatbot_model.py +11 -3
- {chatgraph-0.2.0 → chatgraph-0.2.2}/pyproject.toml +1 -1
- {chatgraph-0.2.0 → chatgraph-0.2.2}/LICENSE +0 -0
- {chatgraph-0.2.0 → chatgraph-0.2.2}/README.md +0 -0
- {chatgraph-0.2.0 → chatgraph-0.2.2}/chatgraph/__init__.py +0 -0
- {chatgraph-0.2.0 → chatgraph-0.2.2}/chatgraph/auth/credentials.py +0 -0
- {chatgraph-0.2.0 → chatgraph-0.2.2}/chatgraph/bot/chatbot_router.py +0 -0
- {chatgraph-0.2.0 → chatgraph-0.2.2}/chatgraph/error/chatbot_error.py +0 -0
- {chatgraph-0.2.0 → chatgraph-0.2.2}/chatgraph/error/route_error.py +0 -0
- {chatgraph-0.2.0 → chatgraph-0.2.2}/chatgraph/messages/base_message_consumer.py +0 -0
- {chatgraph-0.2.0 → chatgraph-0.2.2}/chatgraph/messages/rabbitMQ_message_consumer.py +0 -0
- {chatgraph-0.2.0 → chatgraph-0.2.2}/chatgraph/messages/test_message_consumer.py +0 -0
- {chatgraph-0.2.0 → chatgraph-0.2.2}/chatgraph/types/message_types.py +0 -0
- {chatgraph-0.2.0 → chatgraph-0.2.2}/chatgraph/types/output_state.py +0 -0
- {chatgraph-0.2.0 → chatgraph-0.2.2}/chatgraph/types/route.py +0 -0
- {chatgraph-0.2.0 → chatgraph-0.2.2}/chatgraph/types/user_state.py +0 -0
|
@@ -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)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|