chatgraph 0.2.2__tar.gz → 0.2.3__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.2 → chatgraph-0.2.3}/PKG-INFO +1 -1
- {chatgraph-0.2.2 → chatgraph-0.2.3}/chatgraph/bot/chatbot_model.py +3 -2
- {chatgraph-0.2.2 → chatgraph-0.2.3}/chatgraph/types/output_state.py +6 -6
- {chatgraph-0.2.2 → chatgraph-0.2.3}/pyproject.toml +1 -1
- {chatgraph-0.2.2 → chatgraph-0.2.3}/LICENSE +0 -0
- {chatgraph-0.2.2 → chatgraph-0.2.3}/README.md +0 -0
- {chatgraph-0.2.2 → chatgraph-0.2.3}/chatgraph/__init__.py +0 -0
- {chatgraph-0.2.2 → chatgraph-0.2.3}/chatgraph/auth/credentials.py +0 -0
- {chatgraph-0.2.2 → chatgraph-0.2.3}/chatgraph/bot/chatbot_router.py +0 -0
- {chatgraph-0.2.2 → chatgraph-0.2.3}/chatgraph/error/chatbot_error.py +0 -0
- {chatgraph-0.2.2 → chatgraph-0.2.3}/chatgraph/error/route_error.py +0 -0
- {chatgraph-0.2.2 → chatgraph-0.2.3}/chatgraph/messages/base_message_consumer.py +0 -0
- {chatgraph-0.2.2 → chatgraph-0.2.3}/chatgraph/messages/rabbitMQ_message_consumer.py +0 -0
- {chatgraph-0.2.2 → chatgraph-0.2.3}/chatgraph/messages/test_message_consumer.py +0 -0
- {chatgraph-0.2.2 → chatgraph-0.2.3}/chatgraph/types/message_types.py +0 -0
- {chatgraph-0.2.2 → chatgraph-0.2.3}/chatgraph/types/route.py +0 -0
- {chatgraph-0.2.2 → chatgraph-0.2.3}/chatgraph/types/user_state.py +0 -0
|
@@ -2,6 +2,7 @@ import inspect
|
|
|
2
2
|
from abc import ABC
|
|
3
3
|
from functools import wraps
|
|
4
4
|
from logging import debug
|
|
5
|
+
import json
|
|
5
6
|
|
|
6
7
|
from ..error.chatbot_error import ChatbotError, ChatbotMessageError
|
|
7
8
|
from ..messages.base_message_consumer import MessageConsumer
|
|
@@ -146,9 +147,9 @@ class ChatbotApp(ABC):
|
|
|
146
147
|
'menu': route,
|
|
147
148
|
'obs': user_state.obs,
|
|
148
149
|
}
|
|
149
|
-
return response
|
|
150
|
+
return json.dumps(response)
|
|
150
151
|
elif type(message_response) in (ChatbotResponse, EndChatResponse, TransferToHuman):
|
|
151
|
-
return message_response.json()
|
|
152
|
+
return json.dumps(message_response.json())
|
|
152
153
|
elif type(message_response) == RedirectResponse:
|
|
153
154
|
route = self.__adjust_route(message_response.route, menu)
|
|
154
155
|
message.user_state.menu = route
|
|
@@ -28,10 +28,10 @@ class ChatbotResponse:
|
|
|
28
28
|
'''
|
|
29
29
|
Retorna o objeto em formato json.
|
|
30
30
|
'''
|
|
31
|
-
return
|
|
31
|
+
return {
|
|
32
32
|
'type': 'message',
|
|
33
33
|
'message': self.message,
|
|
34
|
-
}
|
|
34
|
+
}
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
class RedirectResponse:
|
|
@@ -71,11 +71,11 @@ class EndChatResponse:
|
|
|
71
71
|
'''
|
|
72
72
|
Retorna o objeto em formato json.
|
|
73
73
|
'''
|
|
74
|
-
return
|
|
74
|
+
return {
|
|
75
75
|
'type': 'tabulate',
|
|
76
76
|
'tabulation_id': self.tabulation_id,
|
|
77
77
|
'observations': self.observations,
|
|
78
|
-
}
|
|
78
|
+
}
|
|
79
79
|
|
|
80
80
|
class TransferToHuman:
|
|
81
81
|
"""
|
|
@@ -92,8 +92,8 @@ class TransferToHuman:
|
|
|
92
92
|
'''
|
|
93
93
|
Retorna o objeto em formato json.
|
|
94
94
|
'''
|
|
95
|
-
return
|
|
95
|
+
return {
|
|
96
96
|
'type': 'transfer',
|
|
97
97
|
'campaign_id': self.campaign_id,
|
|
98
98
|
'observations': self.observations,
|
|
99
|
-
}
|
|
99
|
+
}
|
|
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
|