chatgraph 0.4.2__py3-none-any.whl → 0.5.0__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/__init__.py +4 -3
- chatgraph/bot/chatbot_model.py +11 -8
- chatgraph/gRPC/gRPCCall.py +61 -145
- chatgraph/messages/message_consumer.py +74 -139
- chatgraph/pb/router.proto +127 -0
- chatgraph/pb/router_pb2.py +77 -0
- chatgraph/pb/router_pb2_grpc.py +669 -0
- chatgraph/types/message_types.py +79 -76
- chatgraph/types/request_types.py +176 -251
- {chatgraph-0.4.2.dist-info → chatgraph-0.5.0.dist-info}/METADATA +1 -1
- chatgraph-0.5.0.dist-info/RECORD +21 -0
- chatgraph/pb/userstate.proto +0 -41
- chatgraph/pb/userstate_pb2.py +0 -47
- chatgraph/pb/userstate_pb2_grpc.py +0 -269
- chatgraph/pb/voll.proto +0 -90
- chatgraph/pb/voll_pb2.py +0 -63
- chatgraph/pb/voll_pb2_grpc.py +0 -470
- chatgraph-0.4.2.dist-info/RECORD +0 -24
- {chatgraph-0.4.2.dist-info → chatgraph-0.5.0.dist-info}/LICENSE +0 -0
- {chatgraph-0.4.2.dist-info → chatgraph-0.5.0.dist-info}/WHEEL +0 -0
- {chatgraph-0.4.2.dist-info → chatgraph-0.5.0.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package chatbot;
|
|
4
|
+
|
|
5
|
+
option go_package = "./chatbot";
|
|
6
|
+
|
|
7
|
+
///// Serviços de Estado do Usuário /////
|
|
8
|
+
service UserStateService {
|
|
9
|
+
rpc InsertUpdateUserState(UserState) returns (RequestStatus);
|
|
10
|
+
rpc DeleteUserState(ChatID) returns (RequestStatus);
|
|
11
|
+
rpc GetUserState(ChatID) returns (UserState);
|
|
12
|
+
rpc GetAllUserStates(Void) returns (UserStateList);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
///// Serviços de Mensagens /////
|
|
16
|
+
service SendMessage {
|
|
17
|
+
rpc SendMessage(Message) returns (RequestStatus);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
///// Serviços de Transfer /////
|
|
21
|
+
service Transfer {
|
|
22
|
+
rpc GetAllCampaigns(Void) returns (CampaignsList);
|
|
23
|
+
rpc GetCampaignID(CampaignName) returns (CampaignDetails);
|
|
24
|
+
rpc TransferToHuman(TransferToHumanRequest) returns (RequestStatus);
|
|
25
|
+
rpc TransferToMenu(TransferToMenuRequest) returns (RequestStatus);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
///// Serviços de EndChat /////
|
|
29
|
+
service EndChat {
|
|
30
|
+
rpc GetAllTabulations(Void) returns (TabulationsList);
|
|
31
|
+
rpc GetTabulationID(TabulationName) returns (TabulationDetails);
|
|
32
|
+
rpc EndChat(EndChatRequest) returns (RequestStatus);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
///// Mensagens Compartilhadas /////
|
|
36
|
+
message Void {}
|
|
37
|
+
|
|
38
|
+
message RequestStatus {
|
|
39
|
+
bool status = 1;
|
|
40
|
+
string message = 2;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
message ChatID {
|
|
44
|
+
string user_id = 1;
|
|
45
|
+
string company_id = 2;
|
|
46
|
+
}
|
|
47
|
+
///// Mensagens para Estado do Usuário /////
|
|
48
|
+
message UserState {
|
|
49
|
+
ChatID chat_id = 1;
|
|
50
|
+
string menu = 2;
|
|
51
|
+
string route = 3;
|
|
52
|
+
string protocol = 4;
|
|
53
|
+
string observation = 5;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
message UserStateList {
|
|
57
|
+
repeated UserState user_states = 1;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
///// Mensagens para Serviços de Mensagens /////
|
|
61
|
+
message TextMessage {
|
|
62
|
+
string type = 1;
|
|
63
|
+
string url = 2;
|
|
64
|
+
string filename = 3;
|
|
65
|
+
string title = 4;
|
|
66
|
+
string detail = 5;
|
|
67
|
+
string caption = 6;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
message Button{
|
|
71
|
+
string type = 1;
|
|
72
|
+
string title = 2;
|
|
73
|
+
string detail = 3;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
message Message {
|
|
77
|
+
ChatID chat_id = 1;
|
|
78
|
+
TextMessage message = 2;
|
|
79
|
+
repeated Button buttons = 3;
|
|
80
|
+
Button display_button = 4;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
///// Mensagens para Serviços de Transfer /////
|
|
84
|
+
message TransferToHumanRequest{
|
|
85
|
+
ChatID chat_id = 1;
|
|
86
|
+
string campaign_id = 2;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
message TransferToMenuRequest{
|
|
90
|
+
ChatID chat_id = 1;
|
|
91
|
+
string menu = 2;
|
|
92
|
+
string user_message = 3;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
message TabulationName{
|
|
96
|
+
string name = 1;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
message TabulationDetails{
|
|
100
|
+
string id = 1;
|
|
101
|
+
string name = 2;
|
|
102
|
+
string last_update = 3;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
message TabulationsList{
|
|
106
|
+
repeated TabulationDetails tabulations = 1;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
///// Serviços de EndChat /////
|
|
110
|
+
message EndChatRequest {
|
|
111
|
+
ChatID chat_id = 1;
|
|
112
|
+
string tabulation_id = 2;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
message CampaignName {
|
|
116
|
+
string name = 1;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
message CampaignDetails {
|
|
120
|
+
string id = 1;
|
|
121
|
+
string name = 2;
|
|
122
|
+
string last_update = 3;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
message CampaignsList {
|
|
126
|
+
repeated CampaignDetails campaigns = 1;
|
|
127
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: router.proto
|
|
5
|
+
# Protobuf Python Version: 5.27.2
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
+
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
5,
|
|
15
|
+
27,
|
|
16
|
+
2,
|
|
17
|
+
'',
|
|
18
|
+
'router.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0crouter.proto\x12\x07\x63hatbot\"\x06\n\x04Void\"0\n\rRequestStatus\x12\x0e\n\x06status\x18\x01 \x01(\x08\x12\x0f\n\x07message\x18\x02 \x01(\t\"-\n\x06\x43hatID\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\x12\n\ncompany_id\x18\x02 \x01(\t\"q\n\tUserState\x12 \n\x07\x63hat_id\x18\x01 \x01(\x0b\x32\x0f.chatbot.ChatID\x12\x0c\n\x04menu\x18\x02 \x01(\t\x12\r\n\x05route\x18\x03 \x01(\t\x12\x10\n\x08protocol\x18\x04 \x01(\t\x12\x13\n\x0bobservation\x18\x05 \x01(\t\"8\n\rUserStateList\x12\'\n\x0buser_states\x18\x01 \x03(\x0b\x32\x12.chatbot.UserState\"j\n\x0bTextMessage\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t\x12\x10\n\x08\x66ilename\x18\x03 \x01(\t\x12\r\n\x05title\x18\x04 \x01(\t\x12\x0e\n\x06\x64\x65tail\x18\x05 \x01(\t\x12\x0f\n\x07\x63\x61ption\x18\x06 \x01(\t\"5\n\x06\x42utton\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\r\n\x05title\x18\x02 \x01(\t\x12\x0e\n\x06\x64\x65tail\x18\x03 \x01(\t\"\x9d\x01\n\x07Message\x12 \n\x07\x63hat_id\x18\x01 \x01(\x0b\x32\x0f.chatbot.ChatID\x12%\n\x07message\x18\x02 \x01(\x0b\x32\x14.chatbot.TextMessage\x12 \n\x07\x62uttons\x18\x03 \x03(\x0b\x32\x0f.chatbot.Button\x12\'\n\x0e\x64isplay_button\x18\x04 \x01(\x0b\x32\x0f.chatbot.Button\"O\n\x16TransferToHumanRequest\x12 \n\x07\x63hat_id\x18\x01 \x01(\x0b\x32\x0f.chatbot.ChatID\x12\x13\n\x0b\x63\x61mpaign_id\x18\x02 \x01(\t\"]\n\x15TransferToMenuRequest\x12 \n\x07\x63hat_id\x18\x01 \x01(\x0b\x32\x0f.chatbot.ChatID\x12\x0c\n\x04menu\x18\x02 \x01(\t\x12\x14\n\x0cuser_message\x18\x03 \x01(\t\"\x1e\n\x0eTabulationName\x12\x0c\n\x04name\x18\x01 \x01(\t\"B\n\x11TabulationDetails\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x0blast_update\x18\x03 \x01(\t\"B\n\x0fTabulationsList\x12/\n\x0btabulations\x18\x01 \x03(\x0b\x32\x1a.chatbot.TabulationDetails\"I\n\x0e\x45ndChatRequest\x12 \n\x07\x63hat_id\x18\x01 \x01(\x0b\x32\x0f.chatbot.ChatID\x12\x15\n\rtabulation_id\x18\x02 \x01(\t\"\x1c\n\x0c\x43\x61mpaignName\x12\x0c\n\x04name\x18\x01 \x01(\t\"@\n\x0f\x43\x61mpaignDetails\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x0blast_update\x18\x03 \x01(\t\"<\n\rCampaignsList\x12+\n\tcampaigns\x18\x01 \x03(\x0b\x32\x18.chatbot.CampaignDetails2\x83\x02\n\x10UserStateService\x12\x43\n\x15InsertUpdateUserState\x12\x12.chatbot.UserState\x1a\x16.chatbot.RequestStatus\x12:\n\x0f\x44\x65leteUserState\x12\x0f.chatbot.ChatID\x1a\x16.chatbot.RequestStatus\x12\x33\n\x0cGetUserState\x12\x0f.chatbot.ChatID\x1a\x12.chatbot.UserState\x12\x39\n\x10GetAllUserStates\x12\r.chatbot.Void\x1a\x16.chatbot.UserStateList2F\n\x0bSendMessage\x12\x37\n\x0bSendMessage\x12\x10.chatbot.Message\x1a\x16.chatbot.RequestStatus2\x9c\x02\n\x08Transfer\x12\x38\n\x0fGetAllCampaigns\x12\r.chatbot.Void\x1a\x16.chatbot.CampaignsList\x12@\n\rGetCampaignID\x12\x15.chatbot.CampaignName\x1a\x18.chatbot.CampaignDetails\x12J\n\x0fTransferToHuman\x12\x1f.chatbot.TransferToHumanRequest\x1a\x16.chatbot.RequestStatus\x12H\n\x0eTransferToMenu\x12\x1e.chatbot.TransferToMenuRequest\x1a\x16.chatbot.RequestStatus2\xcb\x01\n\x07\x45ndChat\x12<\n\x11GetAllTabulations\x12\r.chatbot.Void\x1a\x18.chatbot.TabulationsList\x12\x46\n\x0fGetTabulationID\x12\x17.chatbot.TabulationName\x1a\x1a.chatbot.TabulationDetails\x12:\n\x07\x45ndChat\x12\x17.chatbot.EndChatRequest\x1a\x16.chatbot.RequestStatusB\x0bZ\t./chatbotb\x06proto3')
|
|
28
|
+
|
|
29
|
+
_globals = globals()
|
|
30
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
31
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'router_pb2', _globals)
|
|
32
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
33
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
|
34
|
+
_globals['DESCRIPTOR']._serialized_options = b'Z\t./chatbot'
|
|
35
|
+
_globals['_VOID']._serialized_start=25
|
|
36
|
+
_globals['_VOID']._serialized_end=31
|
|
37
|
+
_globals['_REQUESTSTATUS']._serialized_start=33
|
|
38
|
+
_globals['_REQUESTSTATUS']._serialized_end=81
|
|
39
|
+
_globals['_CHATID']._serialized_start=83
|
|
40
|
+
_globals['_CHATID']._serialized_end=128
|
|
41
|
+
_globals['_USERSTATE']._serialized_start=130
|
|
42
|
+
_globals['_USERSTATE']._serialized_end=243
|
|
43
|
+
_globals['_USERSTATELIST']._serialized_start=245
|
|
44
|
+
_globals['_USERSTATELIST']._serialized_end=301
|
|
45
|
+
_globals['_TEXTMESSAGE']._serialized_start=303
|
|
46
|
+
_globals['_TEXTMESSAGE']._serialized_end=409
|
|
47
|
+
_globals['_BUTTON']._serialized_start=411
|
|
48
|
+
_globals['_BUTTON']._serialized_end=464
|
|
49
|
+
_globals['_MESSAGE']._serialized_start=467
|
|
50
|
+
_globals['_MESSAGE']._serialized_end=624
|
|
51
|
+
_globals['_TRANSFERTOHUMANREQUEST']._serialized_start=626
|
|
52
|
+
_globals['_TRANSFERTOHUMANREQUEST']._serialized_end=705
|
|
53
|
+
_globals['_TRANSFERTOMENUREQUEST']._serialized_start=707
|
|
54
|
+
_globals['_TRANSFERTOMENUREQUEST']._serialized_end=800
|
|
55
|
+
_globals['_TABULATIONNAME']._serialized_start=802
|
|
56
|
+
_globals['_TABULATIONNAME']._serialized_end=832
|
|
57
|
+
_globals['_TABULATIONDETAILS']._serialized_start=834
|
|
58
|
+
_globals['_TABULATIONDETAILS']._serialized_end=900
|
|
59
|
+
_globals['_TABULATIONSLIST']._serialized_start=902
|
|
60
|
+
_globals['_TABULATIONSLIST']._serialized_end=968
|
|
61
|
+
_globals['_ENDCHATREQUEST']._serialized_start=970
|
|
62
|
+
_globals['_ENDCHATREQUEST']._serialized_end=1043
|
|
63
|
+
_globals['_CAMPAIGNNAME']._serialized_start=1045
|
|
64
|
+
_globals['_CAMPAIGNNAME']._serialized_end=1073
|
|
65
|
+
_globals['_CAMPAIGNDETAILS']._serialized_start=1075
|
|
66
|
+
_globals['_CAMPAIGNDETAILS']._serialized_end=1139
|
|
67
|
+
_globals['_CAMPAIGNSLIST']._serialized_start=1141
|
|
68
|
+
_globals['_CAMPAIGNSLIST']._serialized_end=1201
|
|
69
|
+
_globals['_USERSTATESERVICE']._serialized_start=1204
|
|
70
|
+
_globals['_USERSTATESERVICE']._serialized_end=1463
|
|
71
|
+
_globals['_SENDMESSAGE']._serialized_start=1465
|
|
72
|
+
_globals['_SENDMESSAGE']._serialized_end=1535
|
|
73
|
+
_globals['_TRANSFER']._serialized_start=1538
|
|
74
|
+
_globals['_TRANSFER']._serialized_end=1822
|
|
75
|
+
_globals['_ENDCHAT']._serialized_start=1825
|
|
76
|
+
_globals['_ENDCHAT']._serialized_end=2028
|
|
77
|
+
# @@protoc_insertion_point(module_scope)
|