File size: 54,058 Bytes
b36ae4a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from langchain.document_loaders import PyMuPDFLoader, PyPDFLoader"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "import getpass\n",
    "\n",
    "os.environ[\"OPENAI_API_KEY\"] = getpass.getpass(\"OpenAI API Key:\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "from langchain_openai import ChatOpenAI\n",
    "\n",
    "openai_chat_model = ChatOpenAI(model=\"gpt-3.5-turbo\") #gpt-4o"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "from langchain_core.prompts import ChatPromptTemplate"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "data_path = \"data/airbnb_midterm.pdf\"\n",
    "data_url = \"https://airbnb2020ipo.q4web.com/files/doc_financials/2024/q1/fdb60f7d-e616-43dc-86ef-e33d3a9bdd05.pdf\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "docs = PyMuPDFLoader(data_path).load()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "import tiktoken\n",
    "from langchain.text_splitter import RecursiveCharacterTextSplitter\n",
    "\n",
    "def tiktoken_len(text):\n",
    "    tokens = tiktoken.encoding_for_model(\"gpt-4o\").encode(\n",
    "        text,\n",
    "    )\n",
    "    return len(tokens)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "text_splitter = RecursiveCharacterTextSplitter(\n",
    "    chunk_size = 500,\n",
    "    chunk_overlap = 10,\n",
    "    length_function = tiktoken_len,\n",
    ")\n",
    "\n",
    "split_chunks = text_splitter.split_documents(docs)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "495\n"
     ]
    }
   ],
   "source": [
    "max_chunk_length = 0\n",
    "\n",
    "for chunk in split_chunks:\n",
    "  max_chunk_length = max(max_chunk_length, tiktoken_len(chunk.page_content))\n",
    "\n",
    "print(max_chunk_length)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "from langchain_openai.embeddings import OpenAIEmbeddings\n",
    "\n",
    "embedding_model = OpenAIEmbeddings(model=\"text-embedding-3-small\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "from utils.custom_retriver import CustomQDrant, CustomVectorStoreRetriever\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "\n",
    "qdrant_vectorstore = CustomQDrant.from_documents(\n",
    "    split_chunks,\n",
    "    embedding_model,\n",
    "    location=\":memory:\",\n",
    "    collection_name=\"air bnb data\",\n",
    "    score_threshold=0.3\n",
    "    \n",
    ")\n",
    "\n",
    "qdrant_retriever = qdrant_vectorstore.as_retriever()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(Document(page_content='Table of Contents\\nPART I - FINANCIAL INFORMATION\\nItem 1. Condensed Consolidated Financial Statements\\nAirbnb, Inc.\\nCondensed Consolidated Balance Sheets\\n(in millions, except par value)\\n(unaudited)\\nDecember 31,\\n2023\\nMarch 31,\\n2024\\nAssets\\nCurrent assets:\\nCash and cash equivalents\\n$\\n6,874\\xa0 $\\n7,829\\xa0\\nShort-term investments (including assets reported at fair value of $2,507 and $2,524, respectively)\\n3,197\\xa0\\n3,264\\xa0\\nFunds receivable and amounts held on behalf of customers\\n5,869\\xa0\\n8,737\\xa0\\nPrepaids and other current assets (including customer receivables of $249 and $212 and allowances of $44 and $37, respectively)\\n569\\xa0\\n563\\xa0\\nTotal current assets\\n16,509\\xa0\\n20,393\\xa0\\nDeferred tax assets, net\\n2,881\\xa0\\n2,886\\xa0\\nGoodwill and intangible assets, net\\n792\\xa0\\n786\\xa0\\nOther assets, noncurrent\\n463\\xa0\\n472\\xa0\\nTotal assets\\n$\\n20,645\\xa0 $\\n24,537\\xa0\\nLiabilities and Stockholders’ Equity\\nCurrent liabilities:\\nAccrued expenses, accounts payable, and other current liabilities\\n$\\n2,654\\xa0 $\\n2,968\\xa0\\nFunds payable and amounts payable to customers\\n5,869\\xa0\\n8,737\\xa0\\nUnearned fees\\n1,427\\xa0\\n2,434\\xa0\\nTotal current liabilities\\n9,950\\xa0\\n14,139\\xa0\\nLong-term debt\\n1,991\\xa0\\n1,992\\xa0\\nOther liabilities, noncurrent\\n539\\xa0\\n510\\xa0\\nTotal liabilities\\n12,480\\xa0\\n16,641\\xa0\\nCommitments and contingencies (Note 9)\\nStockholders’ equity:\\nCommon stock, $0.0001 par value:\\nClass A - authorized 2,000 shares; 438 and 443 shares issued & outstanding, respectively;\\nClass B - authorized 710 shares; 200 and 193 shares issued & outstanding, respectively;\\nClass C - authorized 2,000 shares; zero shares of Class C common stock issued & outstanding, respectively; and\\nClass H - authorized 26 shares; 9 shares issued and zero shares outstanding, respectively\\n—\\xa0\\n—', metadata={'source': 'data/airbnb_midterm.pdf', 'file_path': 'data/airbnb_midterm.pdf', 'page': 4, 'total_pages': 54, 'format': 'PDF 1.4', 'title': '0001559720-24-000017', 'author': 'EDGAR® Online LLC, a subsidiary of OTC Markets Group', 'subject': 'Form 10-Q filed on 2024-05-08 for the period ending 2024-03-31', 'keywords': '0001559720-24-000017; ; 10-Q', 'creator': 'EDGAR Filing HTML Converter', 'producer': 'EDGRpdf Service w/ EO.Pdf 22.0.40.0', 'creationDate': \"D:20240508161757-04'00'\", 'modDate': \"D:20240508161807-04'00'\", 'trapped': '', 'encryption': 'Standard V2 R3 128-bit RC4', '_id': '571604f40b7247ebbfe404a43d5120a6', '_collection_name': 'air bnb data'}),\n",
       " 0.34878594896405274)"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "qdrant_retriever.invoke(\"Where did air bnb started\")[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "RAG_PROMPT = \"\"\"\n",
    "CONTEXT:\n",
    "{context}\n",
    "\n",
    "QUERY:\n",
    "{question}\n",
    "\n",
    "Answer questions only based on provided context and not your previous knowledge. \n",
    "In your answer never mention phrases like Based on provided context, From the context etc.\n",
    "If you don't know the answer say I don't know!\n",
    "\"\"\"\n",
    "\n",
    "rag_prompt = ChatPromptTemplate.from_template(RAG_PROMPT)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "from operator import itemgetter\n",
    "from langchain.schema.output_parser import StrOutputParser\n",
    "from langchain.schema.runnable import RunnablePassthrough\n",
    "\n",
    "retrieval_augmented_qa_chain = (\n",
    "    # INVOKE CHAIN WITH: {\"question\" : \"<<SOME USER QUESTION>>\"}\n",
    "    # \"question\" : populated by getting the value of the \"question\" key\n",
    "    # \"context\"  : populated by getting the value of the \"question\" key and chaining it into the base_retriever\n",
    "    {\"context\": itemgetter(\"question\") | qdrant_retriever, \"question\": itemgetter(\"question\")}\n",
    "    # \"context\"  : is assigned to a RunnablePassthrough object (will not be called or considered in the next step)\n",
    "    #              by getting the value of the \"context\" key from the previous step\n",
    "    | RunnablePassthrough.assign(context=itemgetter(\"context\"))\n",
    "    # \"response\" : the \"context\" and \"question\" values are used to format our prompt object and then piped\n",
    "    #              into the LLM and stored in a key called \"response\"\n",
    "    # \"context\"  : populated by getting the value of the \"context\" key from the previous step\n",
    "    | {\"response\": rag_prompt | openai_chat_model, \"context\": itemgetter(\"context\")}\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "response = retrieval_augmented_qa_chain.invoke({\"question\" : \"What is Airbnb's 'Description of Business'?\"})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'response': AIMessage(content=\"Airbnb, Inc. operates a global platform for unique stays and experiences. The company's marketplace model connects hosts and guests online or through mobile devices to book spaces and experiences around the world.\", response_metadata={'token_usage': {'completion_tokens': 38, 'prompt_tokens': 3074, 'total_tokens': 3112}, 'model_name': 'gpt-3.5-turbo', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-5c0cac68-ea8d-4dee-bb33-7bca745171d5-0', usage_metadata={'input_tokens': 3074, 'output_tokens': 38, 'total_tokens': 3112}),\n",
       " 'context': [(Document(page_content='Table of Contents\\nAirbnb, Inc.\\nNotes to Condensed Consolidated Financial Statements (unaudited)\\nNote 1. Description of Business\\nAirbnb,\\xa0Inc. (the “Company” or “Airbnb”) was incorporated in Delaware in June\\xa02008 and is headquartered in San Francisco, California. The Company\\xa0operates\\xa0a global platform for\\nunique stays and experiences. The Company’s marketplace model connects hosts and guests (collectively referred to as “customers”) online or through mobile devices to book\\nspaces and experiences around the world.\\nNote 2. Summary of Significant Accounting Policies\\nBasis of Presentation\\nThe accompanying unaudited condensed consolidated financial statements have been prepared in conformity with generally accepted accounting principles in the United States of\\nAmerica (“U.S. GAAP”) and the applicable rules and regulations of the Securities and Exchange Commission (the “SEC”) regarding interim financial information. Certain information\\nand note disclosures normally included in the consolidated financial statements prepared in accordance with U.S. GAAP have been condensed or omitted pursuant to such rules and\\nregulations. As such, the information included in this Quarterly Report on Form 10-Q should be read in conjunction with the audited consolidated financial statements and the related\\nnotes thereto as of and for the year ended December\\xa031, 2023, included in the Company’s Annual Report on Form 10-K, filed with the SEC on February 16, 2024. The results for the\\ninterim periods are not necessarily indicative of results for the full year. Certain immaterial amounts in prior periods have been reclassified to conform with current period\\npresentation.\\nIn the opinion of management, these unaudited condensed consolidated financial statements reflect all adjustments, consisting only of normal recurring adjustments, which are\\nnecessary for the fair statement of the unaudited condensed consolidated financial position, results of operations and cash flows for these interim periods.\\nPrinciples of Consolidation\\nThe accompanying unaudited condensed consolidated financial statements include the accounts of the Company and its wholly-owned subsidiaries in accordance with consolidation\\naccounting guidance. All intercompany transactions have been eliminated in consolidation.\\nUse of Estimates\\nThe preparation of the Company’s unaudited condensed consolidated financial statements in conformity with U.S. GAAP requires management to make certain estimates and\\nassumptions that affect the amounts reported in the unaudited condensed consolidated financial statements and accompanying notes. The Company regularly evaluates its', metadata={'source': 'data/airbnb_midterm.pdf', 'file_path': 'data/airbnb_midterm.pdf', 'page': 9, 'total_pages': 54, 'format': 'PDF 1.4', 'title': '0001559720-24-000017', 'author': 'EDGAR® Online LLC, a subsidiary of OTC Markets Group', 'subject': 'Form 10-Q filed on 2024-05-08 for the period ending 2024-03-31', 'keywords': '0001559720-24-000017; ; 10-Q', 'creator': 'EDGAR Filing HTML Converter', 'producer': 'EDGRpdf Service w/ EO.Pdf 22.0.40.0', 'creationDate': \"D:20240508161757-04'00'\", 'modDate': \"D:20240508161807-04'00'\", 'trapped': '', 'encryption': 'Standard V2 R3 128-bit RC4', '_id': '7d51cb24dfb14858a5c28533096cdbe5', '_collection_name': 'air bnb data'}),\n",
       "   0.5068435691149277),\n",
       "  (Document(page_content='Table of Contents\\nPART I - FINANCIAL INFORMATION\\nItem 1. Condensed Consolidated Financial Statements\\nAirbnb, Inc.\\nCondensed Consolidated Balance Sheets\\n(in millions, except par value)\\n(unaudited)\\nDecember 31,\\n2023\\nMarch 31,\\n2024\\nAssets\\nCurrent assets:\\nCash and cash equivalents\\n$\\n6,874\\xa0 $\\n7,829\\xa0\\nShort-term investments (including assets reported at fair value of $2,507 and $2,524, respectively)\\n3,197\\xa0\\n3,264\\xa0\\nFunds receivable and amounts held on behalf of customers\\n5,869\\xa0\\n8,737\\xa0\\nPrepaids and other current assets (including customer receivables of $249 and $212 and allowances of $44 and $37, respectively)\\n569\\xa0\\n563\\xa0\\nTotal current assets\\n16,509\\xa0\\n20,393\\xa0\\nDeferred tax assets, net\\n2,881\\xa0\\n2,886\\xa0\\nGoodwill and intangible assets, net\\n792\\xa0\\n786\\xa0\\nOther assets, noncurrent\\n463\\xa0\\n472\\xa0\\nTotal assets\\n$\\n20,645\\xa0 $\\n24,537\\xa0\\nLiabilities and Stockholders’ Equity\\nCurrent liabilities:\\nAccrued expenses, accounts payable, and other current liabilities\\n$\\n2,654\\xa0 $\\n2,968\\xa0\\nFunds payable and amounts payable to customers\\n5,869\\xa0\\n8,737\\xa0\\nUnearned fees\\n1,427\\xa0\\n2,434\\xa0\\nTotal current liabilities\\n9,950\\xa0\\n14,139\\xa0\\nLong-term debt\\n1,991\\xa0\\n1,992\\xa0\\nOther liabilities, noncurrent\\n539\\xa0\\n510\\xa0\\nTotal liabilities\\n12,480\\xa0\\n16,641\\xa0\\nCommitments and contingencies (Note 9)\\nStockholders’ equity:\\nCommon stock, $0.0001 par value:\\nClass A - authorized 2,000 shares; 438 and 443 shares issued & outstanding, respectively;\\nClass B - authorized 710 shares; 200 and 193 shares issued & outstanding, respectively;\\nClass C - authorized 2,000 shares; zero shares of Class C common stock issued & outstanding, respectively; and\\nClass H - authorized 26 shares; 9 shares issued and zero shares outstanding, respectively\\n—\\xa0\\n—', metadata={'source': 'data/airbnb_midterm.pdf', 'file_path': 'data/airbnb_midterm.pdf', 'page': 4, 'total_pages': 54, 'format': 'PDF 1.4', 'title': '0001559720-24-000017', 'author': 'EDGAR® Online LLC, a subsidiary of OTC Markets Group', 'subject': 'Form 10-Q filed on 2024-05-08 for the period ending 2024-03-31', 'keywords': '0001559720-24-000017; ; 10-Q', 'creator': 'EDGAR Filing HTML Converter', 'producer': 'EDGRpdf Service w/ EO.Pdf 22.0.40.0', 'creationDate': \"D:20240508161757-04'00'\", 'modDate': \"D:20240508161807-04'00'\", 'trapped': '', 'encryption': 'Standard V2 R3 128-bit RC4', '_id': '571604f40b7247ebbfe404a43d5120a6', '_collection_name': 'air bnb data'}),\n",
       "   0.47142537803546586),\n",
       "  (Document(page_content='Table of Contents\\nAirbnb, Inc.\\nCondensed Consolidated Statements of Operations\\n(in millions, except per share amounts)\\n(unaudited)\\nThree Months Ended\\nMarch 31,\\n2023\\n2024\\nRevenue\\n$\\n1,818\\xa0 $\\n2,142\\xa0\\nCosts and expenses:\\nCost of revenue\\n428\\xa0\\n480\\xa0\\nOperations and support\\n282\\xa0\\n285\\xa0\\nProduct development\\n420\\xa0\\n475\\xa0\\nSales and marketing\\n450\\xa0\\n514\\xa0\\nGeneral and administrative\\n243\\xa0\\n287\\xa0\\nTotal costs and expenses\\n1,823\\xa0\\n2,041\\xa0\\nIncome (loss) from operations\\n(5)\\n101\\xa0\\nInterest income\\n146\\xa0\\n202\\xa0\\nOther expense, net\\n(11)\\n(10)\\nIncome before income taxes\\n130\\xa0\\n293\\xa0\\nProvision for income taxes\\n13\\xa0\\n29\\xa0\\nNet income\\n$\\n117\\xa0 $\\n264\\xa0\\nNet income per share attributable to Class\\xa0A and Class\\xa0B common stockholders:\\nBasic\\n$\\n0.18\\xa0 $\\n0.41\\xa0\\nDiluted\\n$\\n0.18\\xa0 $\\n0.41\\xa0\\nWeighted-average shares used in computing net income per share attributable to Class\\xa0A and Class\\xa0B common stockholders:\\nBasic\\n634\\xa0\\n638\\xa0\\nDiluted\\n670\\xa0\\n654\\xa0\\nThe accompanying notes are an integral part of these condensed consolidated financial statements.\\n4', metadata={'source': 'data/airbnb_midterm.pdf', 'file_path': 'data/airbnb_midterm.pdf', 'page': 5, 'total_pages': 54, 'format': 'PDF 1.4', 'title': '0001559720-24-000017', 'author': 'EDGAR® Online LLC, a subsidiary of OTC Markets Group', 'subject': 'Form 10-Q filed on 2024-05-08 for the period ending 2024-03-31', 'keywords': '0001559720-24-000017; ; 10-Q', 'creator': 'EDGAR Filing HTML Converter', 'producer': 'EDGRpdf Service w/ EO.Pdf 22.0.40.0', 'creationDate': \"D:20240508161757-04'00'\", 'modDate': \"D:20240508161807-04'00'\", 'trapped': '', 'encryption': 'Standard V2 R3 128-bit RC4', '_id': 'ed7f1ec272af484e9ebc8f10e43f8d7c', '_collection_name': 'air bnb data'}),\n",
       "   0.4527725805360773),\n",
       "  (Document(page_content='Table of Contents\\nAirbnb, Inc.\\nNotes to Condensed Consolidated Financial Statements (unaudited)\\nStock Option and Restricted Stock Unit Activity\\nA summary of stock option and restricted stock unit (“RSU”) activity under the Company’s equity incentive plans was as follows (in millions, except per share amounts):\\nOutstanding\\nStock Options\\nOutstanding\\nRSUs\\n\\xa0\\nShares\\nAvailable\\xa0for\\nGrant\\nNumber\\xa0of\\nShares\\nWeighted-\\nAverage\\nExercise\\nPrice\\nNumber\\xa0of\\nShares\\nWeighted-\\nAverage\\nGrant\\nDate Fair\\nValue\\nAs of December 31, 2023\\n134\\xa0\\n7\\xa0 $\\n71.76\\xa0\\n30\\xa0 $\\n85.35\\xa0\\nGranted\\n(7)\\n—\\xa0\\n—\\xa0\\n7\\xa0\\n166.17\\xa0\\nIncrease in shares available for grant\\n13\\xa0\\n—\\xa0\\n—\\xa0\\n—\\xa0\\n—\\xa0\\nOptions exercised/RSUs vested\\n1\\xa0\\n(1)\\n42.12\\xa0\\n(2)\\n109.14\\xa0\\nAs of March 31, 2024\\n141\\xa0\\n6\\xa0 $\\n80.12\\xa0\\n35\\xa0 $\\n100.12\\xa0\\n(1)\\nRSUs vested are net of shares withheld for taxes.\\nNumber of\\nShares\\nWeighted-\\nAverage\\nExercise\\nPrice\\nWeighted-\\nAverage\\nRemaining\\nContractual\\nLife (Years)\\nAggregate\\nIntrinsic\\nValue\\nOptions outstanding as of March 31, 2024\\n6\\xa0 $\\n80.12\\xa0\\n5.87 $\\n541\\xa0\\nOptions exercisable as of March 31, 2024\\n5\\xa0 $\\n66.85\\xa0\\n5.12 $\\n484\\xa0\\nNote 9. Commitments and Contingencies\\nCommitments\\nThe Company has commitments including purchase obligations for web-hosting services and other commitments for brand marketing. As of March\\xa031, 2024, there were no material\\nchanges outside the ordinary course of business to the Company’s commitments, as disclosed in its Annual Report on Form 10-K for the year ended December\\xa031, 2023.\\nLodging Tax Obligations and Other Non-Income Tax Matters\\nPlatform Related Taxes and Collection Obligations\\nSome states and localities in the United States and elsewhere in the world impose transient occupancy or lodging accommodations taxes (“Lodging Taxes”) on the use or occupancy', metadata={'source': 'data/airbnb_midterm.pdf', 'file_path': 'data/airbnb_midterm.pdf', 'page': 16, 'total_pages': 54, 'format': 'PDF 1.4', 'title': '0001559720-24-000017', 'author': 'EDGAR® Online LLC, a subsidiary of OTC Markets Group', 'subject': 'Form 10-Q filed on 2024-05-08 for the period ending 2024-03-31', 'keywords': '0001559720-24-000017; ; 10-Q', 'creator': 'EDGAR Filing HTML Converter', 'producer': 'EDGRpdf Service w/ EO.Pdf 22.0.40.0', 'creationDate': \"D:20240508161757-04'00'\", 'modDate': \"D:20240508161807-04'00'\", 'trapped': '', 'encryption': 'Standard V2 R3 128-bit RC4', '_id': '7ea4cac25d8d48e2a38a69d7c9c245e9', '_collection_name': 'air bnb data'}),\n",
       "   0.45249992651669707)]}"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "response"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[(Document(page_content='Table of Contents\\nPART I - FINANCIAL INFORMATION\\nItem 1. Condensed Consolidated Financial Statements\\nAirbnb, Inc.\\nCondensed Consolidated Balance Sheets\\n(in millions, except par value)\\n(unaudited)\\nDecember 31,\\n2023\\nMarch 31,\\n2024\\nAssets\\nCurrent assets:\\nCash and cash equivalents\\n$\\n6,874\\xa0 $\\n7,829\\xa0\\nShort-term investments (including assets reported at fair value of $2,507 and $2,524, respectively)\\n3,197\\xa0\\n3,264\\xa0\\nFunds receivable and amounts held on behalf of customers\\n5,869\\xa0\\n8,737\\xa0\\nPrepaids and other current assets (including customer receivables of $249 and $212 and allowances of $44 and $37, respectively)\\n569\\xa0\\n563\\xa0\\nTotal current assets\\n16,509\\xa0\\n20,393\\xa0\\nDeferred tax assets, net\\n2,881\\xa0\\n2,886\\xa0\\nGoodwill and intangible assets, net\\n792\\xa0\\n786\\xa0\\nOther assets, noncurrent\\n463\\xa0\\n472\\xa0\\nTotal assets\\n$\\n20,645\\xa0 $\\n24,537\\xa0\\nLiabilities and Stockholders’ Equity\\nCurrent liabilities:\\nAccrued expenses, accounts payable, and other current liabilities\\n$\\n2,654\\xa0 $\\n2,968\\xa0\\nFunds payable and amounts payable to customers\\n5,869\\xa0\\n8,737\\xa0\\nUnearned fees\\n1,427\\xa0\\n2,434\\xa0\\nTotal current liabilities\\n9,950\\xa0\\n14,139\\xa0\\nLong-term debt\\n1,991\\xa0\\n1,992\\xa0\\nOther liabilities, noncurrent\\n539\\xa0\\n510\\xa0\\nTotal liabilities\\n12,480\\xa0\\n16,641\\xa0\\nCommitments and contingencies (Note 9)\\nStockholders’ equity:\\nCommon stock, $0.0001 par value:\\nClass A - authorized 2,000 shares; 438 and 443 shares issued & outstanding, respectively;\\nClass B - authorized 710 shares; 200 and 193 shares issued & outstanding, respectively;\\nClass C - authorized 2,000 shares; zero shares of Class C common stock issued & outstanding, respectively; and\\nClass H - authorized 26 shares; 9 shares issued and zero shares outstanding, respectively\\n—\\xa0\\n—', metadata={'source': 'data/airbnb_midterm.pdf', 'file_path': 'data/airbnb_midterm.pdf', 'page': 4, 'total_pages': 54, 'format': 'PDF 1.4', 'title': '0001559720-24-000017', 'author': 'EDGAR® Online LLC, a subsidiary of OTC Markets Group', 'subject': 'Form 10-Q filed on 2024-05-08 for the period ending 2024-03-31', 'keywords': '0001559720-24-000017; ; 10-Q', 'creator': 'EDGAR Filing HTML Converter', 'producer': 'EDGRpdf Service w/ EO.Pdf 22.0.40.0', 'creationDate': \"D:20240508161757-04'00'\", 'modDate': \"D:20240508161807-04'00'\", 'trapped': '', 'encryption': 'Standard V2 R3 128-bit RC4', '_id': '571604f40b7247ebbfe404a43d5120a6', '_collection_name': 'air bnb data'}),\n",
       "  0.34878594896405274),\n",
       " (Document(page_content='Table of Contents\\nSignatures\\nPursuant to the requirements of the Securities Exchange Act of 1934, the Registrant has duly caused this report to be signed on its behalf by the undersigned thereunto duly\\nauthorized.\\n\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\nAIRBNB, INC.\\n\\xa0\\n\\xa0\\nBy:\\n/s/ Brian Chesky\\nDate: May\\xa08, 2024\\nBrian Chesky\\nChief Executive Officer\\n(Principal Executive Officer)\\n\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\n\\xa0\\n\\xa0\\nBy:\\n/s/ Elinor Mertz\\nDate: May\\xa08, 2024\\nElinor Mertz\\nChief Financial Officer\\n(Principal Financial Officer)\\n31', metadata={'source': 'data/airbnb_midterm.pdf', 'file_path': 'data/airbnb_midterm.pdf', 'page': 33, 'total_pages': 54, 'format': 'PDF 1.4', 'title': '0001559720-24-000017', 'author': 'EDGAR® Online LLC, a subsidiary of OTC Markets Group', 'subject': 'Form 10-Q filed on 2024-05-08 for the period ending 2024-03-31', 'keywords': '0001559720-24-000017; ; 10-Q', 'creator': 'EDGAR Filing HTML Converter', 'producer': 'EDGRpdf Service w/ EO.Pdf 22.0.40.0', 'creationDate': \"D:20240508161757-04'00'\", 'modDate': \"D:20240508161807-04'00'\", 'trapped': '', 'encryption': 'Standard V2 R3 128-bit RC4', '_id': 'efab70111f7e4cfc8539b38f36b095f6', '_collection_name': 'air bnb data'}),\n",
       "  0.34324117962858836),\n",
       " (Document(page_content='Table of Contents\\nAirbnb, Inc.\\nCondensed Consolidated Statements of Operations\\n(in millions, except per share amounts)\\n(unaudited)\\nThree Months Ended\\nMarch 31,\\n2023\\n2024\\nRevenue\\n$\\n1,818\\xa0 $\\n2,142\\xa0\\nCosts and expenses:\\nCost of revenue\\n428\\xa0\\n480\\xa0\\nOperations and support\\n282\\xa0\\n285\\xa0\\nProduct development\\n420\\xa0\\n475\\xa0\\nSales and marketing\\n450\\xa0\\n514\\xa0\\nGeneral and administrative\\n243\\xa0\\n287\\xa0\\nTotal costs and expenses\\n1,823\\xa0\\n2,041\\xa0\\nIncome (loss) from operations\\n(5)\\n101\\xa0\\nInterest income\\n146\\xa0\\n202\\xa0\\nOther expense, net\\n(11)\\n(10)\\nIncome before income taxes\\n130\\xa0\\n293\\xa0\\nProvision for income taxes\\n13\\xa0\\n29\\xa0\\nNet income\\n$\\n117\\xa0 $\\n264\\xa0\\nNet income per share attributable to Class\\xa0A and Class\\xa0B common stockholders:\\nBasic\\n$\\n0.18\\xa0 $\\n0.41\\xa0\\nDiluted\\n$\\n0.18\\xa0 $\\n0.41\\xa0\\nWeighted-average shares used in computing net income per share attributable to Class\\xa0A and Class\\xa0B common stockholders:\\nBasic\\n634\\xa0\\n638\\xa0\\nDiluted\\n670\\xa0\\n654\\xa0\\nThe accompanying notes are an integral part of these condensed consolidated financial statements.\\n4', metadata={'source': 'data/airbnb_midterm.pdf', 'file_path': 'data/airbnb_midterm.pdf', 'page': 5, 'total_pages': 54, 'format': 'PDF 1.4', 'title': '0001559720-24-000017', 'author': 'EDGAR® Online LLC, a subsidiary of OTC Markets Group', 'subject': 'Form 10-Q filed on 2024-05-08 for the period ending 2024-03-31', 'keywords': '0001559720-24-000017; ; 10-Q', 'creator': 'EDGAR Filing HTML Converter', 'producer': 'EDGRpdf Service w/ EO.Pdf 22.0.40.0', 'creationDate': \"D:20240508161757-04'00'\", 'modDate': \"D:20240508161807-04'00'\", 'trapped': '', 'encryption': 'Standard V2 R3 128-bit RC4', '_id': 'ed7f1ec272af484e9ebc8f10e43f8d7c', '_collection_name': 'air bnb data'}),\n",
       "  0.3219234261620314),\n",
       " (Document(page_content='Table of Contents\\nAirbnb, Inc.\\nNotes to Condensed Consolidated Financial Statements (unaudited)\\nNote 1. Description of Business\\nAirbnb,\\xa0Inc. (the “Company” or “Airbnb”) was incorporated in Delaware in June\\xa02008 and is headquartered in San Francisco, California. The Company\\xa0operates\\xa0a global platform for\\nunique stays and experiences. The Company’s marketplace model connects hosts and guests (collectively referred to as “customers”) online or through mobile devices to book\\nspaces and experiences around the world.\\nNote 2. Summary of Significant Accounting Policies\\nBasis of Presentation\\nThe accompanying unaudited condensed consolidated financial statements have been prepared in conformity with generally accepted accounting principles in the United States of\\nAmerica (“U.S. GAAP”) and the applicable rules and regulations of the Securities and Exchange Commission (the “SEC”) regarding interim financial information. Certain information\\nand note disclosures normally included in the consolidated financial statements prepared in accordance with U.S. GAAP have been condensed or omitted pursuant to such rules and\\nregulations. As such, the information included in this Quarterly Report on Form 10-Q should be read in conjunction with the audited consolidated financial statements and the related\\nnotes thereto as of and for the year ended December\\xa031, 2023, included in the Company’s Annual Report on Form 10-K, filed with the SEC on February 16, 2024. The results for the\\ninterim periods are not necessarily indicative of results for the full year. Certain immaterial amounts in prior periods have been reclassified to conform with current period\\npresentation.\\nIn the opinion of management, these unaudited condensed consolidated financial statements reflect all adjustments, consisting only of normal recurring adjustments, which are\\nnecessary for the fair statement of the unaudited condensed consolidated financial position, results of operations and cash flows for these interim periods.\\nPrinciples of Consolidation\\nThe accompanying unaudited condensed consolidated financial statements include the accounts of the Company and its wholly-owned subsidiaries in accordance with consolidation\\naccounting guidance. All intercompany transactions have been eliminated in consolidation.\\nUse of Estimates\\nThe preparation of the Company’s unaudited condensed consolidated financial statements in conformity with U.S. GAAP requires management to make certain estimates and\\nassumptions that affect the amounts reported in the unaudited condensed consolidated financial statements and accompanying notes. The Company regularly evaluates its', metadata={'source': 'data/airbnb_midterm.pdf', 'file_path': 'data/airbnb_midterm.pdf', 'page': 9, 'total_pages': 54, 'format': 'PDF 1.4', 'title': '0001559720-24-000017', 'author': 'EDGAR® Online LLC, a subsidiary of OTC Markets Group', 'subject': 'Form 10-Q filed on 2024-05-08 for the period ending 2024-03-31', 'keywords': '0001559720-24-000017; ; 10-Q', 'creator': 'EDGAR Filing HTML Converter', 'producer': 'EDGRpdf Service w/ EO.Pdf 22.0.40.0', 'creationDate': \"D:20240508161757-04'00'\", 'modDate': \"D:20240508161807-04'00'\", 'trapped': '', 'encryption': 'Standard V2 R3 128-bit RC4', '_id': '7d51cb24dfb14858a5c28533096cdbe5', '_collection_name': 'air bnb data'}),\n",
       "  0.3202661238260939)]"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "qdrant_vectorstore.similarity_search_with_score(\"Where did air bnb started\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[(Document(page_content='Table of Contents\\nPART I - FINANCIAL INFORMATION\\nItem 1. Condensed Consolidated Financial Statements\\nAirbnb, Inc.\\nCondensed Consolidated Balance Sheets\\n(in millions, except par value)\\n(unaudited)\\nDecember 31,\\n2023\\nMarch 31,\\n2024\\nAssets\\nCurrent assets:\\nCash and cash equivalents\\n$\\n6,874\\xa0 $\\n7,829\\xa0\\nShort-term investments (including assets reported at fair value of $2,507 and $2,524, respectively)\\n3,197\\xa0\\n3,264\\xa0\\nFunds receivable and amounts held on behalf of customers\\n5,869\\xa0\\n8,737\\xa0\\nPrepaids and other current assets (including customer receivables of $249 and $212 and allowances of $44 and $37, respectively)\\n569\\xa0\\n563\\xa0\\nTotal current assets\\n16,509\\xa0\\n20,393\\xa0\\nDeferred tax assets, net\\n2,881\\xa0\\n2,886\\xa0\\nGoodwill and intangible assets, net\\n792\\xa0\\n786\\xa0\\nOther assets, noncurrent\\n463\\xa0\\n472\\xa0\\nTotal assets\\n$\\n20,645\\xa0 $\\n24,537\\xa0\\nLiabilities and Stockholders’ Equity\\nCurrent liabilities:\\nAccrued expenses, accounts payable, and other current liabilities\\n$\\n2,654\\xa0 $\\n2,968\\xa0\\nFunds payable and amounts payable to customers\\n5,869\\xa0\\n8,737\\xa0\\nUnearned fees\\n1,427\\xa0\\n2,434\\xa0\\nTotal current liabilities\\n9,950\\xa0\\n14,139\\xa0\\nLong-term debt\\n1,991\\xa0\\n1,992\\xa0\\nOther liabilities, noncurrent\\n539\\xa0\\n510\\xa0\\nTotal liabilities\\n12,480\\xa0\\n16,641\\xa0\\nCommitments and contingencies (Note 9)\\nStockholders’ equity:\\nCommon stock, $0.0001 par value:\\nClass A - authorized 2,000 shares; 438 and 443 shares issued & outstanding, respectively;\\nClass B - authorized 710 shares; 200 and 193 shares issued & outstanding, respectively;\\nClass C - authorized 2,000 shares; zero shares of Class C common stock issued & outstanding, respectively; and\\nClass H - authorized 26 shares; 9 shares issued and zero shares outstanding, respectively\\n—\\xa0\\n—', metadata={'source': 'data/airbnb_midterm.pdf', 'file_path': 'data/airbnb_midterm.pdf', 'page': 4, 'total_pages': 54, 'format': 'PDF 1.4', 'title': '0001559720-24-000017', 'author': 'EDGAR® Online LLC, a subsidiary of OTC Markets Group', 'subject': 'Form 10-Q filed on 2024-05-08 for the period ending 2024-03-31', 'keywords': '0001559720-24-000017; ; 10-Q', 'creator': 'EDGAR Filing HTML Converter', 'producer': 'EDGRpdf Service w/ EO.Pdf 22.0.40.0', 'creationDate': \"D:20240508161757-04'00'\", 'modDate': \"D:20240508161807-04'00'\", 'trapped': '', 'encryption': 'Standard V2 R3 128-bit RC4', '_id': '571604f40b7247ebbfe404a43d5120a6', '_collection_name': 'air bnb data'}),\n",
       "  0.34878594896405274),\n",
       " (Document(page_content='Table of Contents\\nSignatures\\nPursuant to the requirements of the Securities Exchange Act of 1934, the Registrant has duly caused this report to be signed on its behalf by the undersigned thereunto duly\\nauthorized.\\n\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\nAIRBNB, INC.\\n\\xa0\\n\\xa0\\nBy:\\n/s/ Brian Chesky\\nDate: May\\xa08, 2024\\nBrian Chesky\\nChief Executive Officer\\n(Principal Executive Officer)\\n\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\n\\xa0\\n\\xa0\\nBy:\\n/s/ Elinor Mertz\\nDate: May\\xa08, 2024\\nElinor Mertz\\nChief Financial Officer\\n(Principal Financial Officer)\\n31', metadata={'source': 'data/airbnb_midterm.pdf', 'file_path': 'data/airbnb_midterm.pdf', 'page': 33, 'total_pages': 54, 'format': 'PDF 1.4', 'title': '0001559720-24-000017', 'author': 'EDGAR® Online LLC, a subsidiary of OTC Markets Group', 'subject': 'Form 10-Q filed on 2024-05-08 for the period ending 2024-03-31', 'keywords': '0001559720-24-000017; ; 10-Q', 'creator': 'EDGAR Filing HTML Converter', 'producer': 'EDGRpdf Service w/ EO.Pdf 22.0.40.0', 'creationDate': \"D:20240508161757-04'00'\", 'modDate': \"D:20240508161807-04'00'\", 'trapped': '', 'encryption': 'Standard V2 R3 128-bit RC4', '_id': 'efab70111f7e4cfc8539b38f36b095f6', '_collection_name': 'air bnb data'}),\n",
       "  0.34324117962858836),\n",
       " (Document(page_content='Table of Contents\\nAirbnb, Inc.\\nCondensed Consolidated Statements of Operations\\n(in millions, except per share amounts)\\n(unaudited)\\nThree Months Ended\\nMarch 31,\\n2023\\n2024\\nRevenue\\n$\\n1,818\\xa0 $\\n2,142\\xa0\\nCosts and expenses:\\nCost of revenue\\n428\\xa0\\n480\\xa0\\nOperations and support\\n282\\xa0\\n285\\xa0\\nProduct development\\n420\\xa0\\n475\\xa0\\nSales and marketing\\n450\\xa0\\n514\\xa0\\nGeneral and administrative\\n243\\xa0\\n287\\xa0\\nTotal costs and expenses\\n1,823\\xa0\\n2,041\\xa0\\nIncome (loss) from operations\\n(5)\\n101\\xa0\\nInterest income\\n146\\xa0\\n202\\xa0\\nOther expense, net\\n(11)\\n(10)\\nIncome before income taxes\\n130\\xa0\\n293\\xa0\\nProvision for income taxes\\n13\\xa0\\n29\\xa0\\nNet income\\n$\\n117\\xa0 $\\n264\\xa0\\nNet income per share attributable to Class\\xa0A and Class\\xa0B common stockholders:\\nBasic\\n$\\n0.18\\xa0 $\\n0.41\\xa0\\nDiluted\\n$\\n0.18\\xa0 $\\n0.41\\xa0\\nWeighted-average shares used in computing net income per share attributable to Class\\xa0A and Class\\xa0B common stockholders:\\nBasic\\n634\\xa0\\n638\\xa0\\nDiluted\\n670\\xa0\\n654\\xa0\\nThe accompanying notes are an integral part of these condensed consolidated financial statements.\\n4', metadata={'source': 'data/airbnb_midterm.pdf', 'file_path': 'data/airbnb_midterm.pdf', 'page': 5, 'total_pages': 54, 'format': 'PDF 1.4', 'title': '0001559720-24-000017', 'author': 'EDGAR® Online LLC, a subsidiary of OTC Markets Group', 'subject': 'Form 10-Q filed on 2024-05-08 for the period ending 2024-03-31', 'keywords': '0001559720-24-000017; ; 10-Q', 'creator': 'EDGAR Filing HTML Converter', 'producer': 'EDGRpdf Service w/ EO.Pdf 22.0.40.0', 'creationDate': \"D:20240508161757-04'00'\", 'modDate': \"D:20240508161807-04'00'\", 'trapped': '', 'encryption': 'Standard V2 R3 128-bit RC4', '_id': 'ed7f1ec272af484e9ebc8f10e43f8d7c', '_collection_name': 'air bnb data'}),\n",
       "  0.3219234261620314),\n",
       " (Document(page_content='Table of Contents\\nAirbnb, Inc.\\nNotes to Condensed Consolidated Financial Statements (unaudited)\\nNote 1. Description of Business\\nAirbnb,\\xa0Inc. (the “Company” or “Airbnb”) was incorporated in Delaware in June\\xa02008 and is headquartered in San Francisco, California. The Company\\xa0operates\\xa0a global platform for\\nunique stays and experiences. The Company’s marketplace model connects hosts and guests (collectively referred to as “customers”) online or through mobile devices to book\\nspaces and experiences around the world.\\nNote 2. Summary of Significant Accounting Policies\\nBasis of Presentation\\nThe accompanying unaudited condensed consolidated financial statements have been prepared in conformity with generally accepted accounting principles in the United States of\\nAmerica (“U.S. GAAP”) and the applicable rules and regulations of the Securities and Exchange Commission (the “SEC”) regarding interim financial information. Certain information\\nand note disclosures normally included in the consolidated financial statements prepared in accordance with U.S. GAAP have been condensed or omitted pursuant to such rules and\\nregulations. As such, the information included in this Quarterly Report on Form 10-Q should be read in conjunction with the audited consolidated financial statements and the related\\nnotes thereto as of and for the year ended December\\xa031, 2023, included in the Company’s Annual Report on Form 10-K, filed with the SEC on February 16, 2024. The results for the\\ninterim periods are not necessarily indicative of results for the full year. Certain immaterial amounts in prior periods have been reclassified to conform with current period\\npresentation.\\nIn the opinion of management, these unaudited condensed consolidated financial statements reflect all adjustments, consisting only of normal recurring adjustments, which are\\nnecessary for the fair statement of the unaudited condensed consolidated financial position, results of operations and cash flows for these interim periods.\\nPrinciples of Consolidation\\nThe accompanying unaudited condensed consolidated financial statements include the accounts of the Company and its wholly-owned subsidiaries in accordance with consolidation\\naccounting guidance. All intercompany transactions have been eliminated in consolidation.\\nUse of Estimates\\nThe preparation of the Company’s unaudited condensed consolidated financial statements in conformity with U.S. GAAP requires management to make certain estimates and\\nassumptions that affect the amounts reported in the unaudited condensed consolidated financial statements and accompanying notes. The Company regularly evaluates its', metadata={'source': 'data/airbnb_midterm.pdf', 'file_path': 'data/airbnb_midterm.pdf', 'page': 9, 'total_pages': 54, 'format': 'PDF 1.4', 'title': '0001559720-24-000017', 'author': 'EDGAR® Online LLC, a subsidiary of OTC Markets Group', 'subject': 'Form 10-Q filed on 2024-05-08 for the period ending 2024-03-31', 'keywords': '0001559720-24-000017; ; 10-Q', 'creator': 'EDGAR Filing HTML Converter', 'producer': 'EDGRpdf Service w/ EO.Pdf 22.0.40.0', 'creationDate': \"D:20240508161757-04'00'\", 'modDate': \"D:20240508161807-04'00'\", 'trapped': '', 'encryption': 'Standard V2 R3 128-bit RC4', '_id': '7d51cb24dfb14858a5c28533096cdbe5', '_collection_name': 'air bnb data'}),\n",
       "  0.3202661238260939)]"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "qdrant_retriever.invoke(\"Where did air bnb started\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "response = retrieval_augmented_qa_chain.invoke({\"question\" : \"What was the total value of 'Cash and cash equivalents' as of December 31, 2023?\"})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'The effect of exchange rate changes on cash, cash equivalents, and restricted cash on our consolidated statements of cash flows relates to certain of our assets, principally cash\\nbalances held on behalf of customers, that are denominated in currencies other than the functional currency of certain of our subsidiaries. For the three months ended March 31,\\n2024, we recorded a decrease of $111 million in cash, cash equivalents, and restricted cash, primarily due to the strengthening of the U.S. dollar. The impact of exchange rate\\nchanges on cash balances can serve as a natural hedge for the effect of exchange rates on our liabilities to our hosts and guests.\\nWe assess our liquidity in terms of our ability to generate cash to fund our short- and long-term cash requirements. As such, we believe that the cash flows generated from operating\\nactivities will meet our anticipated cash requirements in the short-term. In addition to normal working capital requirements, we anticipate that our short- and long-term cash\\nrequirements will include share repurchases, introduction of new products and offerings, timing and extent of spending to support our efforts to develop our platform, debt\\nrepayments, and expansion of sales and marketing activities. Our future capital requirements, however, will depend on many factors, including, but not limited to our growth,\\nheadcount, and ability to attract and retain customers on our platform. Additionally, we may in the future raise additional capital or incur additional indebtedness to continue to fund\\nour strategic initiatives. On a long-term basis, we would rely on either our access to the capital markets or our credit facility for any long-term funding not provided by operating cash\\nflows and cash on hand. In the event that additional financing is required from outside sources, we may seek to raise additional funds at any time through equity, equity-linked\\narrangements, and/or debt, which may not be available on favorable terms, or at all. If we are unable to raise additional capital when desired and at reasonable rates, our business,\\nresults of operations, and financial condition could be materially adversely affected. Our liquidity is subject to various risks including the risks identified in the section titled\\n\"Quantitative and Qualitative Disclosures about Market Risk\" in Item 3.\\nCritical Accounting Estimates\\nOur discussion and analysis of our financial condition and results of operations are based upon our unaudited condensed consolidated financial statements, which have been'"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "response[\"context\"][1][0].page_content"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [],
   "source": [
    "response = retrieval_augmented_qa_chain.invoke({\"question\" : \"What is the 'maximum number of shares to be sold under the 10b5-1 Trading plan' by Brian Chesky?\"})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'1,146,000'"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "response[\"response\"].content"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[Document(page_content='Table of Contents\\nItem 5. Other Information\\nDirector and Officer 10b5-1 Trading Plans (“10b5-1 Plans”)\\nThe following table sets forth the material terms of 10b5-1 Plans intended to satisfy the affirmative defense conditions of Rule 10b5–1(c) that were adopted, terminated, or modified\\nby our directors and officers during the three months ended March\\xa031, 2024:\\nName and Title of Director or Officer\\nAction\\n\\xa0Date\\nExpiration Date\\nMaximum Number of\\nShares to be Sold\\nUnder the Plan\\nDavid Bernstein, Chief Accounting Officer\\nAdopt\\n2/22/2024\\n1/27/2025\\n41,000\\nBrian Chesky, Chief Executive Officer and Director\\nAdopt\\n2/28/2024\\n11/11/2024\\n1,146,000\\nJoseph Gebbia, Director\\nAdopt\\n2/29/2024\\n10/31/2024\\n1,322,523\\nThere were no “non-Rule 10b5-1 trading arrangements,” as defined in Item 408(c) of Regulation S-K, adopted, terminated, or modified by our directors or officers during the three\\nmonths ended March\\xa031, 2024.\\nItem 6. Exhibits\\nThe documents listed in the Exhibit Index of this Quarterly Report on Form 10-Q are incorporated herein by reference or are filed with this Quarterly Report on Form 10-Q, in each\\ncase as indicated herein (numbered in accordance with Item 601 of Regulation S-K).\\nExhibit Index\\n\\xa0\\nIncorporated by\\nReference\\nExhibit\\nNumber\\xa0\\nExhibit\\xa0Description\\nForm\\nFile Number\\nDate\\nNumber\\nFiled\\nHerewith\\n3.1\\nRestated Certificate of Incorporation of the Registrant\\n8-K\\n001-39778\\n12/14/2020\\n3.1\\n3.2\\nAmended and Restated Bylaws of the Registrant\\n8-K\\n001-39778\\n12/14/2020\\n3.2\\n4.1\\nForm of Warrant to Purchase Class A Common Stock\\nX\\n31.1\\nCertification of Principal Executive Officer pursuant to Rules 13a-14(a) and 15d-14(a) under the Securities', metadata={'source': 'data/airbnb_midterm.pdf', 'file_path': 'data/airbnb_midterm.pdf', 'page': 32, 'total_pages': 54, 'format': 'PDF 1.4', 'title': '0001559720-24-000017', 'author': 'EDGAR® Online LLC, a subsidiary of OTC Markets Group', 'subject': 'Form 10-Q filed on 2024-05-08 for the period ending 2024-03-31', 'keywords': '0001559720-24-000017; ; 10-Q', 'creator': 'EDGAR Filing HTML Converter', 'producer': 'EDGRpdf Service w/ EO.Pdf 22.0.40.0', 'creationDate': \"D:20240508161757-04'00'\", 'modDate': \"D:20240508161807-04'00'\", 'trapped': '', 'encryption': 'Standard V2 R3 128-bit RC4', '_id': '92f3488a73104c2fa5ee55d6c21fc374', '_collection_name': 'air bnb data'}),\n",
       " Document(page_content='Table of Contents\\nAirbnb, Inc.\\nNotes to Condensed Consolidated Financial Statements (unaudited)\\nAdditionally, the following securities were not included in the computation of diluted shares outstanding because the effect would be anti-dilutive (in millions):\\nThree Months Ended\\nMarch 31,\\n2023\\n2024\\nStock options\\n1\\xa0\\n2\\xa0\\nRSUs\\n8\\xa0\\n4\\xa0\\nTotal\\n9\\xa0\\n6\\xa0\\nShare Repurchase Program\\nIn May 2023 and February 2024, the Company announced that its board of directors approved share repurchase programs to purchase up to $2.5\\xa0billion and $6.0\\xa0billion of the\\nCompany’s Class A common stock, respectively.\\nShare repurchases under these share repurchase programs may be made through a variety of methods, such as open market purchases, privately negotiated transactions, block\\ntrades or accelerated share repurchase transactions or by any combination of such methods. Any such repurchases will be made from time to time subject to market and economic\\nconditions, applicable legal requirements and other relevant factors. These share repurchase programs do not obligate the Company to repurchase any specific number of shares\\nand may be modified, suspended or terminated at any time at the Company’s discretion.\\nDuring the three months ended March\\xa031, 2024, the Company repurchased and subsequently retired 4.7 million shares of Class A common stock for $750 million, which completed\\nthe repurchases authorized under the share repurchase program announced in May 2023. As of March\\xa031, 2024, the Company had $6.0\\xa0billion available to repurchase shares of\\nClass A common stock under its share repurchase program.\\n19', metadata={'source': 'data/airbnb_midterm.pdf', 'file_path': 'data/airbnb_midterm.pdf', 'page': 20, 'total_pages': 54, 'format': 'PDF 1.4', 'title': '0001559720-24-000017', 'author': 'EDGAR® Online LLC, a subsidiary of OTC Markets Group', 'subject': 'Form 10-Q filed on 2024-05-08 for the period ending 2024-03-31', 'keywords': '0001559720-24-000017; ; 10-Q', 'creator': 'EDGAR Filing HTML Converter', 'producer': 'EDGRpdf Service w/ EO.Pdf 22.0.40.0', 'creationDate': \"D:20240508161757-04'00'\", 'modDate': \"D:20240508161807-04'00'\", 'trapped': '', 'encryption': 'Standard V2 R3 128-bit RC4', '_id': '16a3305be3724c339a06e732997c8034', '_collection_name': 'air bnb data'}),\n",
       " Document(page_content='Exhibit 4.1\\nIn accordance with Instruction 2 to Item 601 of Regulation S-K, below is a schedule dated as of May 8, 2024 listing the parties that have\\nexecuted a separate Warrant to Purchase Class A Common Stock on the form of warrant that follows and details in which the omitted executed\\nwarrants differ from the form of warrant that follows:\\nWarrantholder\\nNumber of\\nShares\\nGoldman Sachs & Co. LLC\\n500,000\\n==================================================================\\nFORM OF WARRANT TO PURCHASE CLASS A COMMON STOCK\\nNONE OF THIS INSTRUMENT, THE SECURITIES REPRESENTED BY THIS INSTRUMENT OR THE SECURITIES ISSUABLE UPON\\nEXERCISE OF THIS WARRANT HAVE BEEN REGISTERED UNDER THE SECURITIES ACT OF 1933, AS AMENDED (THE “ACT”),\\nOR THE APPLICABLE SECURITIES LAWS OF ANY STATE AND MAY NOT BE TRANSFERRED, SOLD OR OTHERWISE DISPOSED\\nOF EXCEPT WHILE A REGISTRATION STATEMENT RELATING THERETO IS IN EFFECT UNDER THE ACT AND APPLICABLE\\nSTATE SECURITIES LAWS OR PURSUANT TO AN EXEMPTION FROM REGISTRATION UNDER THE ACT OR SUCH LAWS.\\nTHIS INSTRUMENT, THE SECURITIES REPRESENTED BY THIS INSTRUMENT AND THE SECURITIES ISSUABLE UPON\\nEXERCISE OF THIS WARRANT ARE SUBJECT TO RESTRICTIONS ON TRANSFER SET FORTH HEREIN AND IN THE\\nAGREEMENTS CONTEMPLATED HEREBY, INCLUDING THE TRANSFER RESTRICTIONS AGREEMENT, DATED AS OF APRIL 17,\\n2020, BETWEEN THE ISSUER OF THESE SECURITIES AND THE INVESTORS REFERRED TO HEREIN, A COPY OF WHICH IS ON\\nFILE WITH THE ISSUER. THIS INSTRUMENT, THE SECURITIES REPRESENTED BY THIS INSTRUMENT AND THE SECURITIES\\nISSUABLE UPON EXERCISE OF THIS WARRANT MAY NOT BE SOLD OR OTHERWISE TRANSFERRED EXCEPT IN COMPLIANCE\\nWITH THIS INSTRUMENT AND SUCH AGREEMENTS. ANY SALE OR OTHER TRANSFER NOT IN COMPLIANCE WITH THIS\\nINSTRUMENT AND SUCH AGREEMENTS WILL BE VOID. THE ISSUER OF THESE SECURITIES MAY REQUIRE AN OPINION OF', metadata={'source': 'data/airbnb_midterm.pdf', 'file_path': 'data/airbnb_midterm.pdf', 'page': 34, 'total_pages': 54, 'format': 'PDF 1.4', 'title': '0001559720-24-000017', 'author': 'EDGAR® Online LLC, a subsidiary of OTC Markets Group', 'subject': 'Form 10-Q filed on 2024-05-08 for the period ending 2024-03-31', 'keywords': '0001559720-24-000017; ; 10-Q', 'creator': 'EDGAR Filing HTML Converter', 'producer': 'EDGRpdf Service w/ EO.Pdf 22.0.40.0', 'creationDate': \"D:20240508161757-04'00'\", 'modDate': \"D:20240508161807-04'00'\", 'trapped': '', 'encryption': 'Standard V2 R3 128-bit RC4', '_id': 'dbc4a689f8c049158bd5e1b14740fa4f', '_collection_name': 'air bnb data'}),\n",
       " Document(page_content='financial institutions (the \"option counterparties\") at a cost of approximately $100 million. The cap price of the Capped Calls was $360.80 per share of Class A common stock, which\\nrepresented a premium of 100% over the last reported sale price of the Class A common stock of $180.40 per share on March 3, 2021, subject to certain customary adjustments\\nunder the terms of the Capped Call Transactions.\\n26', metadata={'source': 'data/airbnb_midterm.pdf', 'file_path': 'data/airbnb_midterm.pdf', 'page': 28, 'total_pages': 54, 'format': 'PDF 1.4', 'title': '0001559720-24-000017', 'author': 'EDGAR® Online LLC, a subsidiary of OTC Markets Group', 'subject': 'Form 10-Q filed on 2024-05-08 for the period ending 2024-03-31', 'keywords': '0001559720-24-000017; ; 10-Q', 'creator': 'EDGAR Filing HTML Converter', 'producer': 'EDGRpdf Service w/ EO.Pdf 22.0.40.0', 'creationDate': \"D:20240508161757-04'00'\", 'modDate': \"D:20240508161807-04'00'\", 'trapped': '', 'encryption': 'Standard V2 R3 128-bit RC4', '_id': 'd3be83407aec4366a167e51a3a86bb30', '_collection_name': 'air bnb data'})]"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "response[\"context\"]"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.11.9 ('llmops-w5')",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.9"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "c9e5523a24c5cd4eda77ee493767e4015a2e2bbdd0ec52ee3dcc95a5bf09d0e7"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}