{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from langchain.document_loaders import PyMuPDFLoader, PyPDFLoader" ] }, { "cell_type": "code", "execution_count": 3, "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": 4, "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": 5, "metadata": {}, "outputs": [], "source": [ "from langchain_core.prompts import ChatPromptTemplate" ] }, { "cell_type": "code", "execution_count": 6, "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": 7, "metadata": {}, "outputs": [], "source": [ "docs = PyMuPDFLoader(data_path).load()" ] }, { "cell_type": "code", "execution_count": 8, "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": 9, "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": 10, "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": 11, "metadata": {}, "outputs": [], "source": [ "from langchain_openai.embeddings import OpenAIEmbeddings\n", "\n", "embedding_model = OpenAIEmbeddings(model=\"text-embedding-3-small\")" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [], "source": [ "from utils.custom_retriver import CustomQDrant, CustomVectorStoreRetriever\n", "\n" ] }, { "cell_type": "code", "execution_count": 13, "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": 14, "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': 'cd3a5f5a79b8454e8185ade4b614e309', '_collection_name': 'air bnb data'}),\n", " 0.3487656607179074)" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "qdrant_retriever.invoke(\"Where did air bnb started\")[0]" ] }, { "cell_type": "code", "execution_count": 15, "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": 16, "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\" : \"<>\"}\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": 17, "metadata": {}, "outputs": [], "source": [ "response = retrieval_augmented_qa_chain.invoke({\"question\" : \"What is Airbnb's 'Description of Business'?\"})" ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "|Air|bnb|,| Inc|.| was| incorporated| in| Delaware| in| June| |200|8| and| is| headquartered| in| San| Francisco|,| California|.| The| company| operates| a| global| platform| for| unique| stays| and| experiences|.| Its| marketplace| model| connects| hosts| and| guests| online| or| through| mobile| devices| to| book| spaces| and| experiences| around| the| world|.||" ] } ], "source": [ "chunks = []\n", "\n", "async for chunk in retrieval_augmented_qa_chain.astream({\"question\" : \"What is Airbnb's 'Description of Business'?\"}):\n", " chunks.append(chunk)\n", " if \"context\" not in chunk.keys():\n", " print(chunk[\"response\"].content, end=\"|\", flush=True)" ] }, { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "''" ] }, "execution_count": 32, "metadata": {}, "output_type": "execute_result" } ], "source": [ "chunks[1][\"response\"].content" ] }, { "cell_type": "code", "execution_count": 18, "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': 3067, 'total_tokens': 3105}, 'model_name': 'gpt-3.5-turbo', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-4b846bb5-6910-4379-a3e3-e6728cca4788-0', usage_metadata={'input_tokens': 3067, 'output_tokens': 38, 'total_tokens': 3105}),\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': '580457275865420ab26bff61797fa6ee', '_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': 'cd3a5f5a79b8454e8185ade4b614e309', '_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': '6f4f6bd908d14bf59b9f9f69592453b4', '_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': '144217b2ce0a4380a6eb7081cdff49b0', '_collection_name': 'air bnb data'}),\n", " 0.45249992651669707)]}" ] }, "execution_count": 18, "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 }