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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: chatgraph
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: A user-friendly chatbot library
5
5
  Home-page: https://github.com/irissonnlima/chatgraph
6
6
  License: MIT
@@ -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 json.dumps({
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 json.dumps({
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 json.dumps({
95
+ return {
96
96
  'type': 'transfer',
97
97
  'campaign_id': self.campaign_id,
98
98
  'observations': self.observations,
99
- })
99
+ }
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "chatgraph"
3
- version = "0.2.2"
3
+ version = "0.2.3"
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