chatgraph 0.3.11__py3-none-any.whl → 0.3.12__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.
- chatgraph/messages/message_consumer.py +4 -1
- chatgraph/pb/userstate.proto +3 -1
- chatgraph/pb/voll.proto +9 -8
- chatgraph/pb/voll_pb2.py +26 -26
- chatgraph/types/message_types.py +2 -2
- chatgraph/types/request_types.py +24 -13
- {chatgraph-0.3.11.dist-info → chatgraph-0.3.12.dist-info}/METADATA +1 -1
- {chatgraph-0.3.11.dist-info → chatgraph-0.3.12.dist-info}/RECORD +11 -11
- {chatgraph-0.3.11.dist-info → chatgraph-0.3.12.dist-info}/LICENSE +0 -0
- {chatgraph-0.3.11.dist-info → chatgraph-0.3.12.dist-info}/WHEEL +0 -0
- {chatgraph-0.3.11.dist-info → chatgraph-0.3.12.dist-info}/entry_points.txt +0 -0
|
@@ -170,10 +170,13 @@ class MessageConsumer:
|
|
|
170
170
|
type=message.get('type', ''),
|
|
171
171
|
text=message.get('text', ''),
|
|
172
172
|
user_state=UserState(
|
|
173
|
-
customer_id=user_state.get('
|
|
173
|
+
customer_id=user_state.get('customer_id', ''),
|
|
174
174
|
menu=user_state.get('menu', ''),
|
|
175
175
|
route=user_state.get('route', ''),
|
|
176
176
|
lst_update=user_state.get('lst_update', ''),
|
|
177
|
+
direction_in=user_state.get('direction_in', ''),
|
|
178
|
+
voll_id=user_state.get('voll_id', ''),
|
|
179
|
+
platform=user_state.get('platform', ''),
|
|
177
180
|
obs=obs,
|
|
178
181
|
),
|
|
179
182
|
channel=message.get('channel', ''),
|
chatgraph/pb/userstate.proto
CHANGED
chatgraph/pb/voll.proto
CHANGED
|
@@ -27,14 +27,15 @@ message MessageRequest {
|
|
|
27
27
|
string hook_id = 1;
|
|
28
28
|
string enterprise_id = 2;
|
|
29
29
|
string unique_customer_id = 3;
|
|
30
|
-
string
|
|
31
|
-
string
|
|
32
|
-
string
|
|
33
|
-
string
|
|
34
|
-
string
|
|
35
|
-
string
|
|
36
|
-
string
|
|
37
|
-
|
|
30
|
+
string voll_id = 4;
|
|
31
|
+
string message_title = 5;
|
|
32
|
+
string message_text = 6;
|
|
33
|
+
string platform = 7;
|
|
34
|
+
string message_caption = 8;
|
|
35
|
+
string button_title = 9;
|
|
36
|
+
string campaign_name = 10;
|
|
37
|
+
string tabulation_name = 11;
|
|
38
|
+
repeated QuickOption options = 12;
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
message MessageResponse {
|
chatgraph/pb/voll_pb2.py
CHANGED
|
@@ -24,7 +24,7 @@ _sym_db = _symbol_database.Default()
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\nvoll.proto\x12\x0bmessagevoll\"\x06\n\x04Void\"\
|
|
27
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\nvoll.proto\x12\x0bmessagevoll\"\x06\n\x04Void\"\xae\x02\n\x0eMessageRequest\x12\x0f\n\x07hook_id\x18\x01 \x01(\t\x12\x15\n\renterprise_id\x18\x02 \x01(\t\x12\x1a\n\x12unique_customer_id\x18\x03 \x01(\t\x12\x0f\n\x07voll_id\x18\x04 \x01(\t\x12\x15\n\rmessage_title\x18\x05 \x01(\t\x12\x14\n\x0cmessage_text\x18\x06 \x01(\t\x12\x10\n\x08platform\x18\x07 \x01(\t\x12\x17\n\x0fmessage_caption\x18\x08 \x01(\t\x12\x14\n\x0c\x62utton_title\x18\t \x01(\t\x12\x15\n\rcampaign_name\x18\n \x01(\t\x12\x17\n\x0ftabulation_name\x18\x0b \x01(\t\x12)\n\x07options\x18\x0c \x03(\x0b\x32\x18.messagevoll.QuickOption\"2\n\x0fMessageResponse\x12\x0e\n\x06status\x18\x01 \x01(\x08\x12\x0f\n\x07message\x18\x02 \x01(\t\"1\n\x0bQuickOption\x12\r\n\x05title\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\"%\n\x0c\x43\x61mpaignName\x12\x15\n\rcampaign_name\x18\x01 \x01(\t\")\n\x0eTabulationName\x12\x17\n\x0ftabulation_name\x18\x01 \x01(\t\"=\n\x0f\x43\x61mpaignDetails\x12\x15\n\rcampaign_name\x18\x01 \x01(\t\x12\x13\n\x0b\x63\x61mpaign_id\x18\x02 \x01(\t\"R\n\x0f\x43\x61mpaignElement\x12\x13\n\x0b\x63\x61mpaign_id\x18\x01 \x01(\t\x12\x15\n\rcampaign_name\x18\x02 \x01(\t\x12\x13\n\x0blast_update\x18\x03 \x01(\t\"@\n\rCampaignsList\x12/\n\tcampaigns\x18\x01 \x03(\x0b\x32\x1c.messagevoll.CampaignElement\"C\n\x11TabulationDetails\x12\x17\n\x0ftabulation_name\x18\x01 \x01(\t\x12\x15\n\rtabulation_id\x18\x02 \x01(\t\"\xa9\x01\n\x11TabulationElement\x12\x15\n\rtabulation_id\x18\x01 \x01(\t\x12\x17\n\x0ftabulation_name\x18\x02 \x01(\t\x12\x17\n\x0ftabulation_type\x18\x03 \x01(\t\x12\x12\n\ngroup_name\x18\x04 \x01(\t\x12\"\n\x1a\x63ustomer_service_survey_id\x18\x05 \x01(\t\x12\x13\n\x0blast_update\x18\x06 \x01(\t\"F\n\x0fTabulationsList\x12\x33\n\x0btabulations\x18\x01 \x03(\x0b\x32\x1e.messagevoll.TabulationElement2\xfb\x02\n\x0eMessageService\x12G\n\nSendButton\x12\x1b.messagevoll.MessageRequest\x1a\x1c.messagevoll.MessageResponse\x12\x45\n\x08SendList\x12\x1b.messagevoll.MessageRequest\x1a\x1c.messagevoll.MessageResponse\x12\x45\n\x08SendText\x12\x1b.messagevoll.MessageRequest\x1a\x1c.messagevoll.MessageResponse\x12L\n\x0fTransferToHuman\x12\x1b.messagevoll.MessageRequest\x1a\x1c.messagevoll.MessageResponse\x12\x44\n\x07\x45ndChat\x12\x1b.messagevoll.MessageRequest\x1a\x1c.messagevoll.MessageResponse2\xb4\x02\n\x0e\x41\x63tionsService\x12H\n\rGetCampaignID\x12\x19.messagevoll.CampaignName\x1a\x1c.messagevoll.CampaignDetails\x12\x41\n\x10GetCampaignsList\x12\x11.messagevoll.Void\x1a\x1a.messagevoll.CampaignsList\x12N\n\x0fGetTabulationID\x12\x1b.messagevoll.TabulationName\x1a\x1e.messagevoll.TabulationDetails\x12\x45\n\x12GetTabulationsList\x12\x11.messagevoll.Void\x1a\x1c.messagevoll.TabulationsListB\x12Z\x10./pb/messagevollb\x06proto3')
|
|
28
28
|
|
|
29
29
|
_globals = globals()
|
|
30
30
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
@@ -35,29 +35,29 @@ if not _descriptor._USE_C_DESCRIPTORS:
|
|
|
35
35
|
_globals['_VOID']._serialized_start=27
|
|
36
36
|
_globals['_VOID']._serialized_end=33
|
|
37
37
|
_globals['_MESSAGEREQUEST']._serialized_start=36
|
|
38
|
-
_globals['_MESSAGEREQUEST']._serialized_end=
|
|
39
|
-
_globals['_MESSAGERESPONSE']._serialized_start=
|
|
40
|
-
_globals['_MESSAGERESPONSE']._serialized_end=
|
|
41
|
-
_globals['_QUICKOPTION']._serialized_start=
|
|
42
|
-
_globals['_QUICKOPTION']._serialized_end=
|
|
43
|
-
_globals['_CAMPAIGNNAME']._serialized_start=
|
|
44
|
-
_globals['_CAMPAIGNNAME']._serialized_end=
|
|
45
|
-
_globals['_TABULATIONNAME']._serialized_start=
|
|
46
|
-
_globals['_TABULATIONNAME']._serialized_end=
|
|
47
|
-
_globals['_CAMPAIGNDETAILS']._serialized_start=
|
|
48
|
-
_globals['_CAMPAIGNDETAILS']._serialized_end=
|
|
49
|
-
_globals['_CAMPAIGNELEMENT']._serialized_start=
|
|
50
|
-
_globals['_CAMPAIGNELEMENT']._serialized_end=
|
|
51
|
-
_globals['_CAMPAIGNSLIST']._serialized_start=
|
|
52
|
-
_globals['_CAMPAIGNSLIST']._serialized_end=
|
|
53
|
-
_globals['_TABULATIONDETAILS']._serialized_start=
|
|
54
|
-
_globals['_TABULATIONDETAILS']._serialized_end=
|
|
55
|
-
_globals['_TABULATIONELEMENT']._serialized_start=
|
|
56
|
-
_globals['_TABULATIONELEMENT']._serialized_end=
|
|
57
|
-
_globals['_TABULATIONSLIST']._serialized_start=
|
|
58
|
-
_globals['_TABULATIONSLIST']._serialized_end=
|
|
59
|
-
_globals['_MESSAGESERVICE']._serialized_start=
|
|
60
|
-
_globals['_MESSAGESERVICE']._serialized_end=
|
|
61
|
-
_globals['_ACTIONSSERVICE']._serialized_start=
|
|
62
|
-
_globals['_ACTIONSSERVICE']._serialized_end=
|
|
38
|
+
_globals['_MESSAGEREQUEST']._serialized_end=338
|
|
39
|
+
_globals['_MESSAGERESPONSE']._serialized_start=340
|
|
40
|
+
_globals['_MESSAGERESPONSE']._serialized_end=390
|
|
41
|
+
_globals['_QUICKOPTION']._serialized_start=392
|
|
42
|
+
_globals['_QUICKOPTION']._serialized_end=441
|
|
43
|
+
_globals['_CAMPAIGNNAME']._serialized_start=443
|
|
44
|
+
_globals['_CAMPAIGNNAME']._serialized_end=480
|
|
45
|
+
_globals['_TABULATIONNAME']._serialized_start=482
|
|
46
|
+
_globals['_TABULATIONNAME']._serialized_end=523
|
|
47
|
+
_globals['_CAMPAIGNDETAILS']._serialized_start=525
|
|
48
|
+
_globals['_CAMPAIGNDETAILS']._serialized_end=586
|
|
49
|
+
_globals['_CAMPAIGNELEMENT']._serialized_start=588
|
|
50
|
+
_globals['_CAMPAIGNELEMENT']._serialized_end=670
|
|
51
|
+
_globals['_CAMPAIGNSLIST']._serialized_start=672
|
|
52
|
+
_globals['_CAMPAIGNSLIST']._serialized_end=736
|
|
53
|
+
_globals['_TABULATIONDETAILS']._serialized_start=738
|
|
54
|
+
_globals['_TABULATIONDETAILS']._serialized_end=805
|
|
55
|
+
_globals['_TABULATIONELEMENT']._serialized_start=808
|
|
56
|
+
_globals['_TABULATIONELEMENT']._serialized_end=977
|
|
57
|
+
_globals['_TABULATIONSLIST']._serialized_start=979
|
|
58
|
+
_globals['_TABULATIONSLIST']._serialized_end=1049
|
|
59
|
+
_globals['_MESSAGESERVICE']._serialized_start=1052
|
|
60
|
+
_globals['_MESSAGESERVICE']._serialized_end=1431
|
|
61
|
+
_globals['_ACTIONSSERVICE']._serialized_start=1434
|
|
62
|
+
_globals['_ACTIONSSERVICE']._serialized_end=1742
|
|
63
63
|
# @@protoc_insertion_point(module_scope)
|
chatgraph/types/message_types.py
CHANGED
|
@@ -82,9 +82,9 @@ class ListElements:
|
|
|
82
82
|
def __init__(
|
|
83
83
|
self,
|
|
84
84
|
text:str,
|
|
85
|
+
button_title: str,
|
|
86
|
+
elements: dict,
|
|
85
87
|
title: Optional[str] = None,
|
|
86
|
-
button_title: Optional[str] = None,
|
|
87
|
-
elements: dict = None,
|
|
88
88
|
caption: Optional[str] = None,
|
|
89
89
|
absolute_text: bool = False,
|
|
90
90
|
) -> None:
|
chatgraph/types/request_types.py
CHANGED
|
@@ -20,9 +20,11 @@ class UserState:
|
|
|
20
20
|
customer_id: str,
|
|
21
21
|
menu: str,
|
|
22
22
|
route: str,
|
|
23
|
+
voll_id: str,
|
|
24
|
+
platform: str,
|
|
25
|
+
direction_in: bool,
|
|
23
26
|
lst_update: Optional[str]=None,
|
|
24
27
|
obs: Optional[dict] = None,
|
|
25
|
-
direction_in: Optional[bool] = True,
|
|
26
28
|
) -> None:
|
|
27
29
|
|
|
28
30
|
self.customer_id = customer_id
|
|
@@ -31,6 +33,8 @@ class UserState:
|
|
|
31
33
|
self.lst_update = lst_update
|
|
32
34
|
self.obs = obs
|
|
33
35
|
self.direction_in = direction_in
|
|
36
|
+
self.voll_id = voll_id
|
|
37
|
+
self.platform = platform
|
|
34
38
|
|
|
35
39
|
def __str__(self):
|
|
36
40
|
return f"UserState:\n\tcustomer_id={self.customer_id},\n\tmenu={self.menu},\n\troute={self.route},\n\tlst_update={self.lst_update},\n\tobs={self.obs},\n\tdirection_in={self.direction_in}"
|
|
@@ -45,6 +49,9 @@ class UserState:
|
|
|
45
49
|
'menu_id': self.menu,
|
|
46
50
|
'route': self.route,
|
|
47
51
|
'obs': json.dumps(self.obs),
|
|
52
|
+
'direction': self.direction_in,
|
|
53
|
+
'voll_id': self.voll_id,
|
|
54
|
+
'platform': self.platform,
|
|
48
55
|
})
|
|
49
56
|
|
|
50
57
|
def update(self, grpc_uri: Optional[str] = None) -> None:
|
|
@@ -127,11 +134,11 @@ class UserCall:
|
|
|
127
134
|
|
|
128
135
|
elif isinstance(message, ListElements):
|
|
129
136
|
self.__send_list(
|
|
130
|
-
message.text,
|
|
131
|
-
message.title,
|
|
132
|
-
message.button_title,
|
|
133
|
-
message.
|
|
134
|
-
message.
|
|
137
|
+
text=message.text,
|
|
138
|
+
title=message.title,
|
|
139
|
+
button_title=message.button_title,
|
|
140
|
+
caption=message.caption,
|
|
141
|
+
element_list=message.elements,
|
|
135
142
|
)
|
|
136
143
|
else:
|
|
137
144
|
raise ValueError("Tipo de mensagem inválido.")
|
|
@@ -144,7 +151,7 @@ class UserCall:
|
|
|
144
151
|
{
|
|
145
152
|
"hook_id": self.company_phone,
|
|
146
153
|
"enterprise_id": self.customer_phone,
|
|
147
|
-
"unique_customer_id": self.__user_state.
|
|
154
|
+
"unique_customer_id": self.__user_state.voll_id,
|
|
148
155
|
"message_text": text,
|
|
149
156
|
"platform": self.channel,
|
|
150
157
|
}
|
|
@@ -167,7 +174,7 @@ class UserCall:
|
|
|
167
174
|
{
|
|
168
175
|
"hook_id": self.company_phone,
|
|
169
176
|
"enterprise_id": self.customer_phone,
|
|
170
|
-
"unique_customer_id": self.__user_state.
|
|
177
|
+
"unique_customer_id": self.__user_state.voll_id,
|
|
171
178
|
"message_text": text,
|
|
172
179
|
"button_title": title,
|
|
173
180
|
"message_caption": caption,
|
|
@@ -182,12 +189,15 @@ class UserCall:
|
|
|
182
189
|
def __send_list(
|
|
183
190
|
self,
|
|
184
191
|
text:str,
|
|
192
|
+
button_title: str,
|
|
185
193
|
title: str|None = None,
|
|
186
|
-
button_title: str|None = None,
|
|
187
194
|
element_list: list[dict] = None,
|
|
188
195
|
caption: str|None = None,
|
|
189
196
|
) -> None:
|
|
190
197
|
|
|
198
|
+
if not button_title:
|
|
199
|
+
raise NameError('Button Title é um parâmetro obrigatório!')
|
|
200
|
+
|
|
191
201
|
if len(element_list) > 20:
|
|
192
202
|
raise ValueError("O número máximo de elementos é 20.")
|
|
193
203
|
|
|
@@ -195,7 +205,7 @@ class UserCall:
|
|
|
195
205
|
{
|
|
196
206
|
"hook_id": self.company_phone,
|
|
197
207
|
"enterprise_id": self.customer_phone,
|
|
198
|
-
"unique_customer_id": self.__user_state.
|
|
208
|
+
"unique_customer_id": self.__user_state.voll_id,
|
|
199
209
|
"message_text": text,
|
|
200
210
|
"button_title": button_title,
|
|
201
211
|
"message_caption": caption,
|
|
@@ -213,6 +223,7 @@ class UserCall:
|
|
|
213
223
|
"hook_id": self.company_phone,
|
|
214
224
|
"enterprise_id": self.customer_phone,
|
|
215
225
|
"unique_customer_id": self.__user_state.customer_id,
|
|
226
|
+
"voll_id": self.__user_state.voll_id,
|
|
216
227
|
"message_text": message,
|
|
217
228
|
"platform": self.channel,
|
|
218
229
|
"campaign_name": campaign_name,
|
|
@@ -222,15 +233,15 @@ class UserCall:
|
|
|
222
233
|
if not response.status:
|
|
223
234
|
raise ValueError("Erro ao transferir chat para humano.")
|
|
224
235
|
|
|
225
|
-
def end_chat(self, message:str,
|
|
236
|
+
def end_chat(self, message:str, tabulation_name:str) -> None:
|
|
226
237
|
response = self.__wpp_server_client.end_chat(
|
|
227
238
|
{
|
|
239
|
+
"tabulation_name": tabulation_name,
|
|
228
240
|
"hook_id": self.company_phone,
|
|
229
|
-
"enterprise_id": self.customer_phone,
|
|
230
241
|
"unique_customer_id": self.__user_state.customer_id,
|
|
242
|
+
"voll_id": self.__user_state.voll_id,
|
|
231
243
|
"message_text": message,
|
|
232
244
|
"platform": self.channel,
|
|
233
|
-
"campaign_name": campaign_name,
|
|
234
245
|
}
|
|
235
246
|
)
|
|
236
247
|
|
|
@@ -6,19 +6,19 @@ chatgraph/cli/__init__.py,sha256=tfgYhGoKy1nD4STN4xDh6J4VV55RICk7v1GZmzAg-bM,741
|
|
|
6
6
|
chatgraph/error/chatbot_error.py,sha256=4sEcW8vz0eQk2QDmDygucVM4caHliZW5iH7XJvmLBuk,1897
|
|
7
7
|
chatgraph/error/route_error.py,sha256=CY8m82ap7-Sr-DXPsolltRW50TqD__5RyXBmNNJCWr8,793
|
|
8
8
|
chatgraph/gRPC/gRPCCall.py,sha256=jYZg7CvtKWhtv2sQMrSunSmvnnL83MKmNVO8GWmGZ9U,7696
|
|
9
|
-
chatgraph/messages/message_consumer.py,sha256=
|
|
10
|
-
chatgraph/pb/userstate.proto,sha256=
|
|
9
|
+
chatgraph/messages/message_consumer.py,sha256=DYPZA-TTXe4jtcdRZUSfPf-QO0B_aXUzSO3FSwfhWlo,8996
|
|
10
|
+
chatgraph/pb/userstate.proto,sha256=GgjD1K2t8VxrMLkceVnY043xBdXWTPxBzaBhAbAg7yw,859
|
|
11
11
|
chatgraph/pb/userstate_pb2.py,sha256=yk7jWGFgv2eAU5Q4juf8RApedwRRhPez9-y93MaZVlw,2772
|
|
12
12
|
chatgraph/pb/userstate_pb2_grpc.py,sha256=QJEGEmdBL6bkxrTI-gNhGbZpPUFuP5jm7eFu8y21PMI,10340
|
|
13
|
-
chatgraph/pb/voll.proto,sha256=
|
|
14
|
-
chatgraph/pb/voll_pb2.py,sha256=
|
|
13
|
+
chatgraph/pb/voll.proto,sha256=cI9YEy0RCc9FWZwAntoDQQzFBGO3zOM72hbtTkiPiZg,2031
|
|
14
|
+
chatgraph/pb/voll_pb2.py,sha256=WLwE7F1pe_elcnwRnSFqVDcFihLZ3JBq4ScTHNCqWGA,5328
|
|
15
15
|
chatgraph/pb/voll_pb2_grpc.py,sha256=U-_nXTAIEzo2GMYjHiphbSyTx3zyipsnKebFuZuoU1k,17685
|
|
16
16
|
chatgraph/types/end_types.py,sha256=--Ty2gM_y7J-yRAvZV26e4HMUpoguAMAhfOIS9-kQTk,1316
|
|
17
|
-
chatgraph/types/message_types.py,sha256=
|
|
18
|
-
chatgraph/types/request_types.py,sha256=
|
|
17
|
+
chatgraph/types/message_types.py,sha256=l488K4sVhTdOY5bbk47Y-qjfvfyn4h7bpmOFf2xGods,3334
|
|
18
|
+
chatgraph/types/request_types.py,sha256=JS_I4dmrSsvrxdRmIVdXUUyKDTVDy3pISThBAoY2qCE,10728
|
|
19
19
|
chatgraph/types/route.py,sha256=2fuHEPKUL_Vuv4g8pB6M7eJLouxXasqjesdju6_eumE,2757
|
|
20
|
-
chatgraph-0.3.
|
|
21
|
-
chatgraph-0.3.
|
|
22
|
-
chatgraph-0.3.
|
|
23
|
-
chatgraph-0.3.
|
|
24
|
-
chatgraph-0.3.
|
|
20
|
+
chatgraph-0.3.12.dist-info/entry_points.txt,sha256=bO9_Q-PqE5vCNNo6ke_-3j2gHfKQMDGnKDTkNuCdBuA,48
|
|
21
|
+
chatgraph-0.3.12.dist-info/LICENSE,sha256=rVJozpRzDlplOpvI8A1GvmfVS0ReYdZvMWc1j2jV0v8,1090
|
|
22
|
+
chatgraph-0.3.12.dist-info/METADATA,sha256=mJFmkStnO3EE4D3PPg4Gx8RmnmYK4YjxLTKmwGSEZOo,12782
|
|
23
|
+
chatgraph-0.3.12.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
24
|
+
chatgraph-0.3.12.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|