Spaces:
Sleeping
Sleeping
Update models/models.py
Browse files- models/models.py +54 -2
models/models.py
CHANGED
@@ -1,3 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import json
|
2 |
from typing import Optional, List, Dict
|
3 |
|
@@ -11,12 +56,16 @@ class Attachment:
|
|
11 |
|
12 |
|
13 |
class Message:
|
14 |
-
|
|
|
|
|
15 |
self.id = message_id
|
16 |
self.body_len = body_len
|
17 |
self.body = body
|
18 |
self.attachments = attachments
|
19 |
self.company = company
|
|
|
|
|
20 |
|
21 |
|
22 |
def to_json(self):
|
@@ -25,5 +74,8 @@ class Message:
|
|
25 |
"body_len" : self.body_len,
|
26 |
"body": self.body,
|
27 |
"attachments": [attachment.__dict__ for attachment in self.attachments] if self.attachments else None,
|
28 |
-
"company": self.company
|
|
|
|
|
29 |
}
|
|
|
|
1 |
+
Hugging Face's logo
|
2 |
+
Hugging Face
|
3 |
+
Search models, datasets, users...
|
4 |
+
Models
|
5 |
+
Datasets
|
6 |
+
Spaces
|
7 |
+
Posts
|
8 |
+
Docs
|
9 |
+
Pricing
|
10 |
+
|
11 |
+
|
12 |
+
|
13 |
+
Spaces:
|
14 |
+
|
15 |
+
Hushh
|
16 |
+
/
|
17 |
+
hushh-luxury-app
|
18 |
+
|
19 |
+
|
20 |
+
like
|
21 |
+
0
|
22 |
+
|
23 |
+
App
|
24 |
+
Files
|
25 |
+
Community
|
26 |
+
Settings
|
27 |
+
hushh-luxury-app
|
28 |
+
/
|
29 |
+
models
|
30 |
+
/
|
31 |
+
models.py
|
32 |
+
|
33 |
+
Omkar008's picture
|
34 |
+
Omkar008
|
35 |
+
Update models/models.py
|
36 |
+
760e491
|
37 |
+
VERIFIED
|
38 |
+
19 days ago
|
39 |
+
raw
|
40 |
+
history
|
41 |
+
blame
|
42 |
+
edit
|
43 |
+
delete
|
44 |
+
No virus
|
45 |
+
1.28 kB
|
46 |
import json
|
47 |
from typing import Optional, List, Dict
|
48 |
|
|
|
56 |
|
57 |
|
58 |
class Message:
|
59 |
+
#structured_data:Optional[List] add this in the below __init__
|
60 |
+
|
61 |
+
def __init__(self, message_id: str, body_len:int, body: Optional[str], attachments: Optional[List[Attachment]], company: str , high_level_company_type:str,structured_data:Optional[List]):
|
62 |
self.id = message_id
|
63 |
self.body_len = body_len
|
64 |
self.body = body
|
65 |
self.attachments = attachments
|
66 |
self.company = company
|
67 |
+
self.high_level_company_type = high_level_company_type
|
68 |
+
self.structured_data = structured_data
|
69 |
|
70 |
|
71 |
def to_json(self):
|
|
|
74 |
"body_len" : self.body_len,
|
75 |
"body": self.body,
|
76 |
"attachments": [attachment.__dict__ for attachment in self.attachments] if self.attachments else None,
|
77 |
+
"company": self.company,
|
78 |
+
"high_level_company_type":self.high_level_company_type,
|
79 |
+
"structured_data": self.structured_data if self.structured_data else None
|
80 |
}
|
81 |
+
|