Omkar008 commited on
Commit
5916eec
·
verified ·
1 Parent(s): 55d9313

Update models/models.py

Browse files
Files changed (1) hide show
  1. models/models.py +1 -9
models/models.py CHANGED
@@ -13,24 +13,16 @@ class Attachment:
13
  class Message:
14
  #structured_data:Optional[List] add this in the below __init__
15
 
16
- 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]):
17
  self.id = message_id
18
- self.body_len = body_len
19
- self.body = body
20
- self.attachments = attachments
21
  self.company = company
22
- self.high_level_company_type = high_level_company_type
23
  self.structured_data = structured_data
24
 
25
 
26
  def to_json(self):
27
  return {
28
  "id": self.id,
29
- "body_len" : self.body_len,
30
- "body": self.body,
31
- "attachments": [attachment.__dict__ for attachment in self.attachments] if self.attachments else None,
32
  "company": self.company,
33
- "high_level_company_type":self.high_level_company_type,
34
  "structured_data": self.structured_data if self.structured_data else None
35
  }
36
 
 
13
  class Message:
14
  #structured_data:Optional[List] add this in the below __init__
15
 
16
+ def __init__(self, message_id: str ,company: str ,structured_data:Optional[List]):
17
  self.id = message_id
 
 
 
18
  self.company = company
 
19
  self.structured_data = structured_data
20
 
21
 
22
  def to_json(self):
23
  return {
24
  "id": self.id,
 
 
 
25
  "company": self.company,
 
26
  "structured_data": self.structured_data if self.structured_data else None
27
  }
28