dakkoong commited on
Commit
e295bf9
1 Parent(s): fb1d705

initial commit

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. facebook_chat.json +41 -44
app.py CHANGED
@@ -53,7 +53,7 @@ def get_json_file(json_docs):
53
  with open(temp_filepath, "wb") as f:
54
  f.write(json_docs.getvalue())
55
  json_loader = JSONLoader(
56
- file_path='homework4/facebook_chat.json',
57
  jq_schema='.messages[].content',
58
  text_content=False
59
  )
 
53
  with open(temp_filepath, "wb") as f:
54
  f.write(json_docs.getvalue())
55
  json_loader = JSONLoader(
56
+ file_path=temp_filepath,
57
  jq_schema='.messages[].content',
58
  text_content=False
59
  )
facebook_chat.json CHANGED
@@ -1,44 +1,41 @@
1
- {'image': {'creation_timestamp': 1675549016, 'uri': 'image_of_the_chat.jpg'},
2
- 'is_still_participant': True,
3
- 'joinable_mode': {'link': '', 'mode': 1},
4
- 'magic_words': [],
5
- 'messages': [{'content': 'Bye!',
6
- 'sender_name': 'User 2',
7
- 'timestamp_ms': 1675597571851},
8
- {'content': 'Oh no worries! Bye',
9
- 'sender_name': 'User 1',
10
- 'timestamp_ms': 1675597435669},
11
- {'content': 'No Im sorry it was my mistake, the blue one is not '
12
- 'for sale',
13
- 'sender_name': 'User 2',
14
- 'timestamp_ms': 1675596277579},
15
- {'content': 'I thought you were selling the blue one!',
16
- 'sender_name': 'User 1',
17
- 'timestamp_ms': 1675595140251},
18
- {'content': 'Im not interested in this bag. Im interested in the '
19
- 'blue one!',
20
- 'sender_name': 'User 1',
21
- 'timestamp_ms': 1675595109305},
22
- {'content': 'Here is $129',
23
- 'sender_name': 'User 2',
24
- 'timestamp_ms': 1675595068468},
25
- {'photos': [{'creation_timestamp': 1675595059,
26
- 'uri': 'url_of_some_picture.jpg'}],
27
- 'sender_name': 'User 2',
28
- 'timestamp_ms': 1675595060730},
29
- {'content': 'Online is at least $100',
30
- 'sender_name': 'User 2',
31
- 'timestamp_ms': 1675595045152},
32
- {'content': 'How much do you want?',
33
- 'sender_name': 'User 1',
34
- 'timestamp_ms': 1675594799696},
35
- {'content': 'Goodmorning! $50 is too low.',
36
- 'sender_name': 'User 2',
37
- 'timestamp_ms': 1675577876645},
38
- {'content': 'Hi! Im interested in your bag. Im offering $50. Let '
39
- 'me know if you are interested. Thanks!',
40
- 'sender_name': 'User 1',
41
- 'timestamp_ms': 1675549022673}],
42
- 'participants': [{'name': 'User 1'}, {'name': 'User 2'}],
43
- 'thread_path': 'inbox/User 1 and User 2 chat',
44
- 'title': 'User 1 and User 2 chat'}
 
1
+ {"image": {"creation_timestamp": 1675549016, "uri": "image_of_the_chat.jpg"},
2
+ "is_still_participant": "True",
3
+ "joinable_mode": {"link": "", "mode": 1},
4
+ "magic_words": [],
5
+ "messages": [{"content": "Bye!",
6
+ "sender_name": "User 2",
7
+ "timestamp_ms": 1675597571851},
8
+ {"content": "Oh no worries! Bye",
9
+ "sender_name": "User 1",
10
+ "timestamp_ms": 1675597435669},
11
+ {"content": "No Im sorry it was my mistake, the blue one is not for sale",
12
+ "sender_name": "User 2",
13
+ "timestamp_ms": 1675596277579},
14
+ {"content": "I thought you were selling the blue one!",
15
+ "sender_name": "User 1",
16
+ "timestamp_ms": 1675595140251},
17
+ {"content": "Im not interested in this bag. Im interested in the blue one!",
18
+ "sender_name": "User 1",
19
+ "timestamp_ms": 1675595109305},
20
+ {"content": "Here is $129",
21
+ "sender_name": "User 2",
22
+ "timestamp_ms": 1675595068468},
23
+ {"photos": [{"creation_timestamp": 1675595059,
24
+ "uri": "url_of_some_picture.jpg"}],
25
+ "sender_name": "User 2",
26
+ "timestamp_ms": 1675595060730},
27
+ {"content": "Online is at least $100",
28
+ "sender_name": "User 2",
29
+ "timestamp_ms": 1675595045152},
30
+ {"content": "How much do you want?",
31
+ "sender_name": "User 1",
32
+ "timestamp_ms": 1675594799696},
33
+ {"content": "Goodmorning! $50 is too low.",
34
+ "sender_name": "User 2",
35
+ "timestamp_ms": 1675577876645},
36
+ {"content": "Hi! Im interested in your bag. Im offering $50. Let me know if you are interested. Thanks!",
37
+ "sender_name": "User 1",
38
+ "timestamp_ms": 1675549022673}],
39
+ "participants": [{"name": "User 1"}, {"name": "User 2"}],
40
+ "thread_path": "inbox/User 1 and User 2 chat",
41
+ "title": "User 1 and User 2 chat"}