kanno927 commited on
Commit
f89223f
·
1 Parent(s): ef5e6f9

feature(#134): fixed some incorrect naming formats

Browse files
.gitignore CHANGED
@@ -1,3 +1,4 @@
1
  /Brain/firebase_cred.json
2
  /.idea
3
  Brain/firebase_cred.json
 
 
1
  /Brain/firebase_cred.json
2
  /.idea
3
  Brain/firebase_cred.json
4
+ Brain/logs
Brain/logs/activity.log DELETED
@@ -1,150 +0,0 @@
1
- 2023-06-11 01:39:05,597 ERROR sendNotification
2
- 2023-06-11 03:49:04,950 DEBUG Chat with AI on model : gpt-3.5-turbo
3
- 2023-06-11 03:49:04,950 DEBUG ------------ CONTEXT SENT TO AI ---------------
4
- 2023-06-11 03:49:04,950 DEBUG System: You are a helpful assistant.
5
- 2023-06-11 03:49:04,950 DEBUG
6
- 2023-06-11 03:49:04,950 DEBUG User: Who won the world series in 2020?
7
- 2023-06-11 03:49:04,950 DEBUG
8
- 2023-06-11 03:49:04,950 DEBUG Assistant: The Los Angeles Dodgers won the World Series in 2020.
9
- 2023-06-11 03:49:04,950 DEBUG
10
- 2023-06-11 03:49:04,950 DEBUG User: Where was it played?
11
- 2023-06-11 03:49:04,951 DEBUG
12
- 2023-06-11 03:49:04,951 DEBUG ----------- END OF CONTEXT ----------------
13
- 2023-06-11 03:49:14,350 WARNING API Rate Limit Reached. Waiting 10 seconds... Error:
14
- 2023-06-11 03:49:34,004 DEBUG Chat with AI on model : gpt-3.5-turbo
15
- 2023-06-11 03:49:34,004 DEBUG ------------ CONTEXT SENT TO AI ---------------
16
- 2023-06-11 03:49:34,004 DEBUG System: You are a helpful assistant.
17
- 2023-06-11 03:49:34,004 DEBUG
18
- 2023-06-11 03:49:34,004 DEBUG User: Who won the world series in 2020?
19
- 2023-06-11 03:49:34,004 DEBUG
20
- 2023-06-11 03:49:34,004 DEBUG Assistant: The Los Angeles Dodgers won the World Series in 2020.
21
- 2023-06-11 03:49:34,004 DEBUG
22
- 2023-06-11 03:49:34,004 DEBUG User: Where was it played?
23
- 2023-06-11 03:49:34,004 DEBUG
24
- 2023-06-11 03:49:34,004 DEBUG ----------- END OF CONTEXT ----------------
25
- 2023-06-11 03:50:02,195 DEBUG Chat with AI on model : gpt-3.5-turbo
26
- 2023-06-11 03:50:02,196 DEBUG ------------ CONTEXT SENT TO AI ---------------
27
- 2023-06-11 03:50:02,196 DEBUG System: You are a helpful assistant.
28
- 2023-06-11 03:50:02,196 DEBUG
29
- 2023-06-11 03:50:02,196 DEBUG User: Who won the world series in 2020?
30
- 2023-06-11 03:50:02,197 DEBUG
31
- 2023-06-11 03:50:02,197 DEBUG Assistant: The Los Angeles Dodgers won the World Series in 2020.
32
- 2023-06-11 03:50:02,197 DEBUG
33
- 2023-06-11 03:50:02,197 DEBUG User: Where was it played?
34
- 2023-06-11 03:50:02,197 DEBUG
35
- 2023-06-11 03:50:02,197 DEBUG ----------- END OF CONTEXT ----------------
36
- 2023-06-11 03:52:01,682 WARNING API Rate Limit Reached. Waiting 10 seconds... Error:
37
- 2023-06-11 03:52:04,881 DEBUG Chat with AI on model : gpt-3.5-turbo
38
- 2023-06-11 03:52:04,882 DEBUG ------------ CONTEXT SENT TO AI ---------------
39
- 2023-06-11 03:52:04,882 DEBUG System: You are a helpful assistant.
40
- 2023-06-11 03:52:04,882 DEBUG
41
- 2023-06-11 03:52:04,882 DEBUG User: Who won the world series in 2020?
42
- 2023-06-11 03:52:04,883 DEBUG
43
- 2023-06-11 03:52:04,883 DEBUG Assistant: The Los Angeles Dodgers won the World Series in 2020.
44
- 2023-06-11 03:52:04,883 DEBUG
45
- 2023-06-11 03:52:04,884 DEBUG User: Where was it played?
46
- 2023-06-11 03:52:04,884 DEBUG
47
- 2023-06-11 03:52:04,884 DEBUG ----------- END OF CONTEXT ----------------
48
- 2023-06-11 03:59:41,875 DEBUG Chat with AI on model : gpt-3.5-turbo
49
- 2023-06-11 03:59:41,876 DEBUG ------------ CONTEXT SENT TO AI ---------------
50
- 2023-06-11 03:59:41,876 DEBUG System: You are a helpful assistant.
51
- 2023-06-11 03:59:41,876 DEBUG
52
- 2023-06-11 03:59:41,876 DEBUG User: Who won the world series in 2020?
53
- 2023-06-11 03:59:41,876 DEBUG
54
- 2023-06-11 03:59:41,876 DEBUG Assistant: The Los Angeles Dodgers won the World Series in 2020.
55
- 2023-06-11 03:59:41,876 DEBUG
56
- 2023-06-11 03:59:41,876 DEBUG User: Where was it played?
57
- 2023-06-11 03:59:41,876 DEBUG
58
- 2023-06-11 03:59:41,876 DEBUG ----------- END OF CONTEXT ----------------
59
- 2023-06-12 17:08:50,779 DEBUG Chat with AI on model : gpt-3.5-turbo
60
- 2023-06-12 17:08:50,780 DEBUG ------------ CONTEXT SENT TO AI ---------------
61
- 2023-06-12 17:08:50,780 DEBUG System: You are a helpful assistant.
62
- 2023-06-12 17:08:50,780 DEBUG
63
- 2023-06-12 17:08:50,780 DEBUG User: Who won the world series in 2020?
64
- 2023-06-12 17:08:50,780 DEBUG
65
- 2023-06-12 17:08:50,780 DEBUG Assistant: The Los Angeles Dodgers won the World Series in 2020.
66
- 2023-06-12 17:08:50,780 DEBUG
67
- 2023-06-12 17:08:50,780 DEBUG User: Where was it played?
68
- 2023-06-12 17:08:50,780 DEBUG
69
- 2023-06-12 17:08:50,780 DEBUG ----------- END OF CONTEXT ----------------
70
- 2023-06-16 14:22:55,555 ERROR sendNotification json parsing or get completion error
71
- 2023-06-16 14:23:59,508 ERROR sendNotification json parsing or get completion error
72
- 2023-06-16 15:58:51,640 DEBUG Chat with AI on model : gpt-3.5-turbo
73
- 2023-06-16 15:58:51,641 DEBUG ------------ CONTEXT SENT TO AI ---------------
74
- 2023-06-16 15:58:51,641 DEBUG System: You are a helpful assistant.
75
- 2023-06-16 15:58:51,642 DEBUG
76
- 2023-06-16 15:58:51,642 DEBUG User: Who won the world series in 2020?
77
- 2023-06-16 15:58:51,642 DEBUG
78
- 2023-06-16 15:58:51,642 DEBUG Assistant: The Los Angeles Dodgers won the World Series in 2020.
79
- 2023-06-16 15:58:51,642 DEBUG
80
- 2023-06-16 15:58:51,642 DEBUG User: Where was it played?
81
- 2023-06-16 15:58:51,642 DEBUG
82
- 2023-06-16 15:58:51,642 DEBUG ----------- END OF CONTEXT ----------------
83
- 2023-07-03 10:06:48,789 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
84
- 2023-07-03 10:07:47,383 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
85
- 2023-07-03 10:09:40,968 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
86
- 2023-07-03 10:09:41,781 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
87
- 2023-07-03 10:09:42,235 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
88
- 2023-07-03 10:09:42,488 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
89
- 2023-07-03 10:09:42,702 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
90
- 2023-07-03 10:09:43,137 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
91
- 2023-07-03 10:12:51,954 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
92
- 2023-07-03 10:12:55,854 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
93
- 2023-07-03 10:12:56,315 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
94
- 2023-07-03 10:12:56,494 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
95
- 2023-07-03 10:12:56,669 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
96
- 2023-07-03 10:12:56,844 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
97
- 2023-07-03 10:12:57,027 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
98
- 2023-07-03 10:12:57,206 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
99
- 2023-07-03 10:12:57,405 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
100
- 2023-07-03 10:13:09,986 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
101
- 2023-07-03 10:13:10,726 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
102
- 2023-07-03 10:13:10,990 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
103
- 2023-07-03 10:13:11,189 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
104
- 2023-07-03 10:13:11,447 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
105
- 2023-07-03 10:14:35,915 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
106
- 2023-07-03 10:18:00,271 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
107
- 2023-07-03 10:18:54,453 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
108
- 2023-07-03 10:21:17,365 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
109
- 2023-07-03 10:23:34,997 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
110
- 2023-07-03 10:25:09,893 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
111
- 2023-07-03 11:21:29,208 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
112
- 2023-07-03 11:24:57,955 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
113
- 2023-07-03 11:25:41,177 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
114
- 2023-07-03 11:27:16,257 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
115
- 2023-07-03 11:31:47,355 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
116
- 2023-07-03 11:33:22,193 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
117
- 2023-07-03 11:36:54,459 WARNING firebase init this app name: firebase_admin_c40a09075d11940f does not exist
118
- 2023-07-03 11:38:09,068 WARNING firebase init this app name: firebase_admin_c40a09075d11940f does not exist
119
- 2023-07-03 11:40:06,026 WARNING firebase init this app name: firebase_admin_c40a09075d11940f does not exist
120
- 2023-07-03 12:01:41,199 WARNING firebase init this app name: firebase_admin_c40a09075d11940f does not exist
121
- 2023-07-03 12:13:21,659 WARNING firebase init this app name: firebase_admin_c40a09075d11940f does not exist
122
- 2023-07-03 12:14:24,045 WARNING firebase init this app name: firebase_admin_c40a09075d11940f does not exist
123
- 2023-07-03 13:09:06,092 WARNING firebase init this app name: firebase_admin_c40a09075d11940f does not exist
124
- 2023-07-03 13:16:55,458 WARNING firebase init this app name: firebase_admin_c40a09075d11940f does not exist
125
- 2023-07-03 13:19:16,702 WARNING firebase init this app name: firebase_admin_c40a09075d11940f does not exist
126
- 2023-07-03 13:22:30,756 WARNING firebase init this app name: firebase_admin_c40a09075d11940f does not exist
127
- 2023-07-03 13:23:54,066 WARNING firebase init this app name: firebase_admin_c40a09075d11940f does not exist
128
- 2023-07-03 13:29:27,247 WARNING firebase init this app name: firebase_admin_c40a09075d11940f does not exist
129
- 2023-07-03 13:30:58,188 WARNING firebase init this app name: firebase_admin_c40a09075d11940f does not exist
130
- 2023-07-03 13:32:43,530 WARNING firebase init this app name: firebase_admin_c40a09075d11940f does not exist
131
- 2023-07-03 13:41:03,580 WARNING firebase init this app name: firebase_admin_c40a09075d11940f does not exist
132
- 2023-07-03 13:41:26,972 WARNING firebase init this app name: firebase_admin_dfgsdfgsdfgsdg does not exist
133
- 2023-07-03 13:48:00,860 WARNING firebase init this app name: firebase_admin_dfgsdfgsdfgsdg does not exist
134
- 2023-07-03 13:51:15,192 WARNING firebase init this app name: firebase_admin_dfgsdfgsdfgsdg does not exist
135
- 2023-07-03 13:53:51,267 WARNING firebase init this app name: firebase_admin_dfgsdfgsdfgsdg does not exist
136
- 2023-07-03 14:29:17,511 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
137
- 2023-07-03 14:30:30,323 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
138
- 2023-07-03 14:31:12,692 WARNING firebase init this app name: firebase_admin_956a11be45cba4a4 does not exist
139
- 2023-07-03 14:31:42,634 WARNING firebase init this app name: firebase_admin_dfgsdfgsdfgsdg does not exist
140
- 2023-07-03 14:55:11,661 WARNING firebase init this app name: firebase_admin_asdfasdfsdfsdf does not exist
141
- 2023-07-03 15:03:27,521 WARNING firebase init this app name: firebase_admin_asdfasdfsdfsdf does not exist
142
- 2023-07-03 15:05:01,280 WARNING firebase init this app name: firebase_admin_asdfasdfsdsdfsdf does not exist
143
- 2023-07-03 15:23:04,910 WARNING firebase init this app name: firebase_admin_sadfasdfsdf does not exist
144
- 2023-07-03 15:26:35,180 WARNING firebase init this app name: firebase_admin_asdfasdfasdf does not exist
145
- 2023-07-03 15:32:39,238 WARNING firebase init this app name: firebase_admin_asdfasdfasdf does not exist
146
- 2023-07-03 15:34:55,373 WARNING firebase init this app name: firebase_admin_45qrtaer345tret does not exist
147
- 2023-07-03 16:21:15,252 WARNING firebase init this app name: firebase_admin_45qrtaer345tret does not exist
148
- 2023-07-03 17:01:09,415 WARNING firebase init this app name: firebase_admin_45qrtaer345tret does not exist
149
- 2023-07-03 17:45:56,553 WARNING firebase init this app name: firebase_admin_45qrtaer345tret does not exist
150
- 2023-07-04 05:52:58,591 WARNING firebase init this app name: firebase_admin_45qrtaer345tret does not exist
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Brain/src/model/requests/request_model.py CHANGED
@@ -217,7 +217,7 @@ class AutoTaskDelete(BasicReq):
217
  data: Body
218
 
219
 
220
- """endpoint : /contact/getbyIds"""
221
 
222
 
223
  class GetContactsByIds(BasicReq):
 
217
  data: Body
218
 
219
 
220
+ """endpoint : /contact/get_by_ids"""
221
 
222
 
223
  class GetContactsByIds(BasicReq):
Brain/src/router/api.py CHANGED
@@ -515,8 +515,8 @@ def construct_blueprint_api() -> APIRouter:
515
 
516
  """
517
 
518
- @router.post("/contacts/getByIds")
519
- def getContactsByIds(data: GetContactsByIds):
520
  try:
521
  setting, firebase_app = firebase_admin_with_setting(data)
522
  except BrainException as ex:
@@ -527,7 +527,7 @@ def construct_blueprint_api() -> APIRouter:
527
 
528
  result = ContactsService(
529
  firebase_app=firebase_app, setting=setting
530
- ).getContactsByIds(uuid=uuid, contactIds=data.contactIds)
531
 
532
  return assembler.to_response(200, "Success to get contacts by uuid", result)
533
 
 
515
 
516
  """
517
 
518
+ @router.post("/contacts/get_contacts_by_ids")
519
+ def get_contacts_by_ids(data: GetContactsByIds):
520
  try:
521
  setting, firebase_app = firebase_admin_with_setting(data)
522
  except BrainException as ex:
 
527
 
528
  result = ContactsService(
529
  firebase_app=firebase_app, setting=setting
530
+ ).get_contacts_by_ids(uuid=uuid, contactIds=data.contactIds)
531
 
532
  return assembler.to_response(200, "Success to get contacts by uuid", result)
533
 
Brain/src/service/contact_service.py CHANGED
@@ -138,7 +138,7 @@ class ContactsService:
138
  )
139
  contacts_doc_ref.delete()
140
 
141
- def getContactsByIds(self, uuid: str, contactIds: list[str]) -> []:
142
  phones_doc_ref = self.phones_ref.document(uuid)
143
  contacts_ref = phones_doc_ref.collection("contacts")
144
 
 
138
  )
139
  contacts_doc_ref.delete()
140
 
141
+ def get_contacts_by_ids(self, uuid: str, contactIds: list[str]) -> []:
142
  phones_doc_ref = self.phones_ref.document(uuid)
143
  contacts_ref = phones_doc_ref.collection("contacts")
144