Qdrant
Last updated
Last updated
Installing the Undatasio Python API library
# install undatasio
!pip install -U -q undatasio
Install the **python-dotenv module and load environment variables using the load_dotenv() function.**
If you are unsure which environment variables are required, you can check the file named dev.env for explanations of the environment variables.
!conda install -c conda-forge python-dotenv -y -q
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done
# All requested packages already installed.
import os
from dotenv import load_dotenv
load_dotenv('.env')
True
Use the Undatasio python SDK
To import an UnDataIO object, you need a token and an optional task name from the Undatasio platform.
from undatasio.undatasio import UnDatasIO
undatasio_obj = UnDatasIO(os.getenv("UNDATASIO_API_KEY"))
The get_result_to_langchain_document function of the Undatasio object returns a Langchain Document object. Parameters for this function can be gleaned from the data returned by the show_version function.
lc_document = undatasio_obj.get_result_to_langchain_document(
type_info=['text'],
file_name='1d8c9bc374114b6e901da.pdf',
version='v26'
)
lc_document
Document(metadata={'source': '_v26_1d8c9bc374114b6e901da.pdf_[text]'}, page_content='2. Profit-takingxpullback has developed into a minor correction. While the10\\%\ncorrection Since mid-May is broadly in-line with the historical norms of most technical\n bull runs, the six-week market weakness has prompted increasing investor questions\nabout the strengthof thepolicy put, and concerns regarding a redux of the powerful but\nshort-livedRe0peningrallyinlate2022/early2023.Empirically,inthe23episodesinthe\npast 20 years where MSCl China rallied more than20\\%, the market almost in all cases\n(22 out of 23) experienced at least a5\\% pullback after entering a technical bull phase.\nThese corrections averaged12\\%by magnitude, and 32 days in duration, although their\nsubsequent return trajectory varied significantly post the initial retreat, with earnings\naccrual/upgrades typically taking over from valuation to drive further gains when these\nupswings transitioned into a fundamental-led cycle. See point 6 for detail.\nSource:FactSet,MSCl,GoldmanSachsGlobalInvestmentResearch\n3.All eyes are on the July policy meetings. July will be a hectic month for China\npolicy watchers: The Third Plenum of the Chinese Communist Party is scheduled for July\n15 to 18, followed by the economically-focused Politburo meeting in July, usually\nconvened end of the month. As detailed in their Third Plenum preview note, our\neconomists expect the reform focus to be on both containing left-tail risks and growing\nright-tail potential for China in the "post-property" era, with fiscal/tax and land reforms\npossibly taking the center stage. However, "big bazooka" policy surprises that some\ninvestors have hoped for since the onset of the housing market downturn remain\nunlikely. Indeed, both onshore and offshore investors we have met in the past month\nare somewhat disappointed with the policy intensity, efficacy, and momentum since the\nApril Politburo meeting, and their expectations on additional stimulus and major\nreform breakthroughs from the July policy meetings are conservative across the\nbroad. A few clients even expressed concerns about downside policy risks relatingjtol :$\nconsumption tax hikes and other contractionary fiscal policy (e.g. tax investigation for\ncorporates).\n5. A tepid recovery in sentiment and flows. "What could turn things around?" was\nheavilyfeaturedinmanyofourclientconversations,reflectingcontinuedreluctance\nfrom fundamental investors to underwrite Chinese growth beyond the short term, in our\nview.However,the+30\\%rally(\\mathsf{U S S1.5t n}increaseinmarketcap)inthesecondlargest\nequitymarketgloballyhasmarginallyhelpedreviveinvestorinterestinChinese\nequity,evidencedbytherisingturnoverinandthestrongSouthboundflowsintothe\nHong Kong market, and the reopening of the capital market for Chinese corporates in\n2Q, led by CB issuances. But, fund positioning and portfolio flows haven\'t fully\ncaughtupwiththeimprovedsentiment:mutualfund andhedgefundexposuresto\nChina equity are still at the low-end of the historical ranges, onshore mutual funds\' cash\nratios are atrecent-year highs, and local retail flows(proxied by mutual fund subscription\nand margin financing balance in A shares) have been stagnated for several months.\nBesides Southbound buying, which has amounted to US$48bn ytd compared to\nonshore ETF trading and inflows in the past week, suggesting to us that the\ncommitment and readiness for government intervention is still strong when SHCOMP is\nnear or below the 3,0o0 psychological threshold.\n6.Earningshavebeendelivered,veryselectively.MSCIChinareceiveditsfirst\nmonthly consensus earnings upgrade in May in the past 12 months, offering investors a\nglimmer of hope that the protracted earnings downcycle is near the tail end. We hold a\nneutral view on earnings and reiterate our\\scriptstyle{\\mathfrak{s}}\\%EPS growth assumption for MScl\nChinain2024,considering: 1)sell-side consensus forecast of12\\%and14\\%EPS\ngrowth for 2024 and 2025 still looks overly optimistic, even taking technical factors\n(dilution,indexrebalancing)andsectorrepresentationissuesintoaccount; 2)the\nupgrades have only manifested in the TMT and service-oriented sectors but the top-line \nand profitability headwinds are still in place for the property and manufacturingcohorts;\n3) high-frequency profit indicators for 2Q suggest that the earnings momentum for the\nbroader market may have stabilized, but seems prematurejtocall for an inflection point.\nEncouragingly, from our extensive discussions with China-focused analysts and PMs,\nbuy-side earnings growth expectations seem to be around mid-single-digit territory,\nimplying that the potential earnings misses to sell-side expectations may not be as\ninfluential to equityprices as the headline numbers would suggest.\nSource: FactSet, MSCl, CSI, IBES, Goldman Sachs Global Investment Research\n7. Left tail risks have been curtailed in equity valuations. The latest correction has\nlowered MSCl China fP/E from10.6\\timesat recent peaks to9.2\\timesat present, and from12.2\\times\nto11.4\\timesfor A shares, but still meaningfully above the lows of7.9\\timesand9.6\\timesin late\nJanuary respectively. The policy put—spanning conventional macro policy, the housing\nmarket,andthecapitalmarkets—hashelpedcontainedsystemicrisksstemmingfrom\nLGFVs and property-related assets, thereby catalyzing the tail-risk-compression rally in\nequities from April to May, and providing a floor to valuation. Our macro-derived\n10.5\\times\nmacro outlooks per GS forecasts, suggesting moderate potential re-rating:gains from\nhere. On our central premise that the strike price of the policy putisunlikely to be raised\nand further policy delivery on housing will be made, we see the risk to valuation\n更多\nfavorablyskewedtotheupside\n70\nSource:GoldmanSachs Global Investment Research\n8. Tariff risks may keep some investors at bay before the US election. The\nforthcoming US presidential election and its implications on China are top-of-mind. The\n10. The "Returns" of "Shareholders" in China. Despite its outperformance in past few\nyears, we believe the theme of shareholder returns will continue to produce strong and\nstable returns for equity investors for five reasons: a) strong policy push and delivery to\nimprove shareholder returns; b) Additional fiscal revenue for financially-strained\ngovernments: every 1pp rise in payout ratios could raise fiscal revenue by Rmb23bn; c)\nChina\'s ability to return cash to shareholders looks promising——low payout ratios (30\\%+)\nbut with record-high cash balances (Rmb18tn) and free cashflows (FY23: Rmb2.6tn); d)\nstable dividend incomes are attractively priced in China where rates are falling; and, e)\nlikelystructural demand forstableincomesfrom domesticinstitutionalinvestors.We\nconstruct a China Shareholder Returns Portfolio, which consists of 3 broad equity\ncohorts-StableCashCows,Dividend/buybacksurprisecandidates,andSelect\nexpected togenerate3\\%shareholder return yields and5\\%FCF yields in 2024 on16\\%\ncash/marketcapratioatmedianstock.\nWe, Kinger Lau, CFA, Timothy Moe, CFA, Si Fu, Ph.D. and Kevin Wang, CFA, hereby certify that all of the views expressed in this report accurately\nreflect our personal views, which have not been influenced by considerations of the firm\'s business or client relationships.\nUnless otherwise stated, the individuals listed on the cover page of this report are analysts in Goldman Sachs\' Global Investment Research division.\nSee company-specific regulatory disclosures above for any of the following disclosures required as to companies referred to in this report: manager or\nco-manager inapendingtransaction;\\uparrow\\%or other ownership; compensation for certain services; types of client relationships; managed/co-managed\npublic offeringsinpriorperiods; directorships;for equitysecurities, market making and/orspecialistrole.GoldmanSachs trades or maytrade as a\nprincipal indebtsecurities(or inrelatedderivatives)ofissuersdiscussed in thisreport.\nThe following are additional required disclosures: Ownership and material conflicts of interest: Goldman Sachs policy prohibits its analysts,\nprofessionals reporting to analysts and members of their households from owning securities of any company in the analyst\'s area of coverage.\nAnalyst compensation: Analysts are paid in part based on the profitability of Goldman Sachs, which includes investment banking revenues. Analyst\nas officer or director: Goldman Sachs policy generally prohibits its analysts, persons reporting to analysts or members of their households from\nserving as an officer, director or advisor of any company in thelanalyst\'s area of coverage. Non-U.s.Analysts: Non-U.S. analysts may not be\nassociated persons of Goldman Sachs & Co. LLC and therefore may not be subject to FINRA Rule 2241 or FINRA Rule 2242 restrictions on\ncommunications with subject company, public appearances and trading securities held by the analysts.\nThefollowingdisclosuresarethoserequiredbythejurisdiction indicated,excepttotheextent alreadymade abovepursuanttoUnitedStateslawsand\nregulations.Australia: Goldman Sachs Australia PtyLtd and its affiliates are not authorised deposit-taking institutions (as that term is defined in the\nBanking Act 1959 (Cth) in Australia and do not provide banking services, nor carry on a banking business, in Australia. This research, and any access to\nit, is intended only for"wholesale clients"within the meaning of the Australian Corporations Act, unless otherwise agreed by Goldman Sachs. In\nproducing research reports, members of Global Investment Research of GoldmanSachs Australia may attend site visits and other meetings hosted by\nthe companies and other entities which are the subject of its research reports. In some instances the costs of such site visits or meetings may be met\nin part or in whole by the issuers concerned if Goldman Sachs Australia considers it is appropriate and reasonable in the specific circumstances relating\nto the site visit or meeting. To the extent that the contents of this document contains any financial product advice, it is general advice only and has\nbeen prepared by Goldman Sachs without taking into account a client\'s objectives, financial situation or needs. A client should, before acting on any\nsuch advice, consider the appropriateness of the advice having regard to the client\'s own objectives,financial situation and needs. A copy of certain\nGoldman Sachs Australia and New Zealand disclosure of interests and a copy of Goldman Sachs\' Australian Sel-Side Research Independence Policy\nStatement are available at: https://www.goldmansachs.com/disclosures/australia-new-zealand/index.html. Brazil: Disclosure information in relation to\n CVM Resolution n. 20 is available at https://www.gs.com/worldwide/brazil/area/gir/index.html. Where applicable, the Brazil-registered analyst primarily\nresponsibleforthecontent of this researchreport, asdefined inArticle20of CVMResolutionn.20, is thefirst author named atthebeginning of this\nreport, unless indicated otherwise at the end of the text. Canada: This information is being provided to you for information purposes only and is not,\nand under no circumstances should be construed as, an advertisement, offering or solicitation by Goldman Sachs & Co. LLC for purchasers of\nsecurities in Canada to trade in any Canadian security.GoldmanSachs& Co.LLC is not registered as a dealer in anyjurisdiction in Canada under\napplicableCanadiansecuritieslawsandgenerallyisnotpermittedtotradeinCanadiansecuritiesandmaybeprohibitedfromsellingcertainsecurities\nandproductsincertainjurisdictionsinCanada.IfyouwishtotradeinanyCanadiansecuritiesorotherproductsinCanadapleasecontactGoldman\nSachsCanadaInc.,anaffiliateof TheGoldmanSachsGroupInc.,OranotherregisteredCanadiandealer.HongKong:Furtherinformation onthe\nsecurities of covered companiesreferred toin thisresearch maybe obtained onrequest from GoldmanSachs(Asia)L.L.C.India:Furtherinformation\non the subject company or companies referred to in this research may be obtained from Goldman Sachs (India) Securities Private Limited, Research\nAnalyst-SEBI RegistrationNumberINH000001493,951-A,Rational House,AppasahebMaratheMarg,Prabhadevi,Mumbai400025,India,Corporate\nIdentity Number U74140MH2006FTC160634, Phone+912266169000,Fax+9122 6616 9001. Goldman Sachs may beneficially own1\\%Ormoreof\nthe securities (as such term is defined in clause 2 (h) the Indian Securities Contracts (Regulation) Act,Jj1956) of the subject company or companies\nreferred toin thisresearchreport. Investment insecuritiesmarket aresubjecttomarketrisks.Read\'all therelated documents carefullybefore\ninvesting. Registration granted by SEBl and certification from NiSM in no way guaranteeperformance of the intermediary or provide any assurance of\nreturns to investors. Goldman Sachs (India) Securities Private Limited Investor Grievance E-mail: india-client-support@gs.com. Compliance Officer: Anil\nRajputITel:+\\;9\\uparrow22 6616 9000|Email: anil.m.rajput@gs.com.Japan: See below.Korea:This research,and any access to it, is intended only for\n\'professional investors"within the meaning of the Financial Services and Capital Markets Act, unless otherwise agreed by Goldman Sachs. Further\ninformation on the subject company or companies referred to\'in this research may be obtained from Goldman Sachs (Asia) L.L.C., Seoul Branch. New\nZealand:GoldmanSachs NewZealand Limited and its affiliates are neither"registered banks"nor"deposit takers"(as defined in the ReserveBank of\nNewZealand Act 1989) inNewZealand.This research,and any accesstoit, is intended for"wholesaleclients"(as defined in theFinancialAdvisers Act\n2008) unless otherwise agreed by Goldman Sachs. A copy of certain Goldman Sachs Australia and New Zealand disclosure of interests is available at:\nhttps://www.goldmansachs.com/disclosures/australia-new-zealand/index.html. Russia: Research reports distributed in the Russian Federation are not\nadvertising asdefinedintheRussianlegislation,butareinformationand analysisnot havingproductpromotionas theirmainpurpose anddonot\nprovide appraisallwithin the meaning of the Russianlegislation on appraisal activity.Research reports do not constitute a personalized investment\nrecommendation as defined in Russian laws and regulations, are not addressed to a specific client, and are prepared without analyzing the financial\ncircumstances,investmentprofilesorriskprofilesofclients.GoldmanSachsassumesnoresponsibilityforanyinvestmentdecisionsthatmaybetaken\nby a client or any other person based on this research report. Singapore: Goldman Sachs (Singapore) Pte. (Company Number: 198602165W), which is\nregulated by the Monetary Authority of Singapore, accepts legal responsibility for this research, and should be contacted with respect to any matters\narisingfrom,orinconnectionwith,thisresearch.Taiwan:Thismaterialisforreferenceonlyandmustnotbereprintedwithoutpermission.Investors\nshould carefully consider their own investment risk. Investment results are the responsibility of the individual investor. United Kingdom: Persons who\nwould be categorized as retail clients in the United Kingdom, as such term is defined in the rules of the Financial Conduct Authority, should read this\nresearch in conjunction with prior Goldman Sachs research on the covered companies referred to herein and should refer to the risk warnings that have\nbeensenttothembyGoldmanSachsInternational.Acopyoftheseriskswarnings,andaglossaryofcertainfinancialtermsusedinthisreport,are\navailable from Goldman Sachs International on request.\nEuropeanUnion and United Kingdom:Disclosureinformation inrelationtoArticle6(2)of theEuropeanCommissionDelegated Regulation(EU)\n(2016/958) supplementing Regulation(EU) No596/2014 of the EuropeanParliament and of the Council (including as that Delegated Regulation is\nimplemented into United Kingdom domestic law and regulation following the United Kingdom\'s departure from the European Union and the European\nEconomicArea)withregardtoregulatorytechnicalstandardsforthetechnical arrangementsforobjectivepresentationofinvestment\nrecommendations or other information recommending or suggesting an investment strategy and for disclosure of particular interests or indications of\nconflicts of interest is available at https://www.gs.com/disclosures/europeanpolicy.html which states the European Policy for Managing Conflicts of\nInterestinConnectionwithInvestment Research.\nJapan: Goldman Sachs Japan Co., Ltd. is a Financial Instrument Dealer registered with the Kanto Financial Bureau under registration number Kinsho\n69, and a member of Japan Securities Dealers Association, Financial Futures Association of Japan Type Il Financial Instruments Firms Association, The\nInvestment Trusts Association, Japan, and Japan Investment Advisers Association. Sales and purchase of equities are subject to commission\npre-determined with clients plus consumption tax. See company-specific disclosures as to any applicable disclosures required by Japanese stock\nexchanges, the Japanese Securities Dealers Association or the Japanese Securities Finance Company.\nGoldman Sachs Global Investment Research produces and distributes research products for clients of Goldman Sachs on a global basis. Analysts based\ninGoldmanSachsofficesaroundtheworldproduceresearchon industries and companies,andresearchonmacroeconomics,currencies,commodities\nand portfolio strategy. This research is disseminated in Australia by Goldman Sachs Australia Pty Ltd (ABN 21 006 797 897); in Brazi\'by Goldman Sachs\ndoBrasil CorretoradeTituloseValoresMobiliariosS.A.;PublicCommunicationChannel GoldmanSachsBrazil:08007275764 and/ or\ncontatogoldmanbrasil@gs.com.AvailableWeekdays (except holidays),from9am to 6pm.Canal de Comunicacao com Publico GoldmanSachsBrasil:\n0800 7275764 e/ou contatogoldmanbrasil@gs.com.Horario de funcionamento: segunda-feira a sexta-feira (excetoferiados), das 9h as 18h; in Canada\nby Goldman Sachs & Co. LLC; in Hong Kong by Goldman Sachs (Asia) L.L.C.; in India by Goldman Sachs (India) Securities Private Ltd.; in Japan by\nGoldman Sachs Japan Co., Ltd.; in the Republic of Korea by Goldman Sachs (Asia) L.L.C., Seoul Branch; in New Zealand by Goldman Sachs New\nZealand Limited; in Russia by O0O Goldman Sachs; in Singapore by Goldman Sachs (Singapore) Pte. (Company Number: 198602165W); and in the\nUnited States of America by Goldman Sachs & Co. LLC. Goldman Sachs International has approved this research in connection with its distribution in\ntheUnitedKingdom.\nGoldman Sachs International ("GSl"), authorised by the Prudential Regulation Authority ("PRA") and regulated by the Financial Conduct Authority\n("FCA") and the PRA, has approved this research,in connection with its distribution in the United Kingdom.\nEuropean Economic Area: GSl, authorisedby the PRA and regulated by the FCA and the PRA, disseminates research in the following jurisdictions\nwithin the European Economic Area: the Grand Duchy of Luxembourg, Italy, the Kingdom of Belgium, the Kingdom of Denmark, the Kingdom of\nNorway, the Republic of Finland and the Republic of Ireland; GSl -Succursale de Paris (Paris branch) which is authorised by the French Autorité de\ncontrole prudentielet de resolution ("ACPR") and regulated by the Autorité de controle prudentiel et de resolution and the Autorité des marches\nfinanciers ("AME") disseminates research in France; GSl - Sucursal en Espana (Madrid branch) authorized in Spain by the Comision Nacional del\nMercadodeValores disseminatesresearch in theKingdom of Spain;GSl-SwedenBankfilial(Stockholmbranch)is authorized by theSFSA as a"third\ncountry branch" in accordance with Chapter 4, Section 4 of the Swedish Securities and Market Act (Sw. lag (2007:528) om vardepappersmarknaden)\ndisseminates research in the Kingdom of Sweden; Goldman Sachs Bank Europe SE ("GSBE") is a credit institution incorporated in Germany and, within\nthe Single Supervisory Mechanism, subject to direct prudential supervision by the European Central Bank and in other respects supervised by German\nFederal Financial Supervisory Authority(Bundesanstalt fur Finanzdienstleistungsaufsicht, BaFin) and Deutsche Bundesbank and disseminates research\nintheFederal RepublicofGermanyand thosejurisdictionswithintheEuropeanEconomicAreawhereGSlisnotauthorised todisseminateresearch\nand additionally, GSBE, Copenhagen Branch filial af GSBE, Tyskland, supervised by the Danish Financial Authority disseminates research in the Kingdom\nof Denmark; GSBE - Sucursal en Espana (Madrid branch) subject (to a limited extent) to local supervision by the Bank of Spain disseminates research in\nthe Kingdom of Spain; GSBE - Succursale Italia (Milan branch) to the relevant applicable extent, subject to local supervision by the Bank of Italy (Banca\nd\'ltalia) and the Italian Companies and Exchange Commission(Commissione Nazionale per le Societae laBorsa"Consob")disseminatesresearch in\nItaly; GSBE - Succursale de Paris (Paris branch), supervised by the AMF and by the ACPR disseminates research in France; and GSBE - Sweden\nBankfilial (Stockholm branch), to a limited extent, subject to local supervision by the Swedish Financial Supervisory Authority (Finansinpektionen)\ndisseminatesresearchintheKingdomofSweden.\nconsider reliable, but we do not represent it is accurate or complete, and it should not be relied on as such. The information, opinions,estimates and\nforecasts contained herein are as of the date hereof and are subject to change without prior notification. We seek to update our research as\nappropriate, but various regulations may prevent us from doing so. Other than certain industry reports published on a periodic basis, the large majority\nofreportsarepublishedatirregularintervalsasappropriateintheanalyst\'sjudgment.inuy\nGoldman Sachs conducts a global full-service, integrated investment banking, investment management, and brokerage business. We have investment\nbankingandotherbusinessrelationshipswithasubstantialpercentageofthecompaniescoveredbyGlobalInvestmentResearch.GoldmanSachs&\nOur salespeople, traders, and other professionals may provide oral or written market commentary or trading strategies to our clients and principal\ntrading desks that reflect opinions that are contrary to the opinions expressed in this research. Our asset management area, principal trading desks and\ninvesting businesses may make investment decisions that are jnconsistent with the recommendations or views expressed in this research.\nWe and our affiliates, officers, directors, and employees will from time to time have long or short positions in, act as principal in, and buy or sell, the\nsecurities or derivatives, if any, referred to in this research, unless otherwise prohibited by regulation or Goldman Sachs policy.\nTheviews attributed to third partypresenters at GoldmanSachs arranged conferences,including individuals from other partsof GoldmanSachs, do not\nnecessarilyreflectthoseofiGlobal InvestmentResearchandarenotanofficialviewofGoldmanSachs.\nAny third party referenced herein, including any salespeople, traders and other professionals or members of their household, may have positions in the\nproducts mentioned that are inconsistent with the views expressed by analysts named in this report.\nThis research is focused on investment themes across markets, industries and sectors. It does not attempt to distinguish between the prospects or\nperformance of, or provide analysis of, individual companies within any industry or sector we describe.\nAnytradingrecommendationin thisresearchrelatingtoanequityorcreditsecurityorsecuritieswithinanindustryorsectorisreflectiveofthe\ninvestmentthemebeingdiscussedandisnotarecommendationofanysuchsecurityinisolation.\nThis research is not an offer to sell or the solicitation of an offer to buy any security in any jurisdiction where such an offer or solicitation would be\nillegal. It does not constitute a personal recommendation or take into account the particular investment objectives, financial situations, or needs of\nindividual clients.Clients should consider whether any advice orrecommendation inthis research is suitablefor their particular circumstances and, if\nappropriate,seekprofessionaladvice,includingtaxadvice.Thepriceandvalueofinvestmentsreferredtointhisresearchandtheincomefromthem\nmay fluctuate. Past performance is not a guide to future performance, future returns are not guaranteed, and a loss of original capital may occur.\nFluctuationsinexchangeratescouldhaveadverseeffectsonthevalueorpriceof,orincomederivedfrom,certaininvestments.\nCertain transactions, including those involving futures, options, and other derivatives, give rise to substantial risk and are not suitable for all investors\nInvestors should review current options and futures disclosure documents which are available from Goldman Sachs sales representatives or at\nhttps://www.theocc.com/about/publications/character-risks.jsp and\nhttps://www.fiadocumentation.org/fia/regulatory-disclosures_1/fia-uniform-futures-and-options-on-futures-risk-disclosures-booklet-pdf-version-2018\nTransaction costs may be significant in option strategies calling for multiple purchase and sales of options such as spreads. Supporting documentation\nwillbesupplieduponrequest.\nDiffering Levelsof Serviceprovided by Global Investment Research:Thelevel and types ofservicesprovided toyou by GoldmanSachs Global\nInvestmentResearchmayvaryascomparedto thatprovidedtointernal and otherexternal clients ofGS,depending onvariousfactors includingyour\nindividual preferences as to the frequency and manner of receiving communication, your risk profile and investment focus and perspective (e.g.,\nmarketwide, sector specific, long term, short term),the size and scope of your overall client relationship with GS, and legal and regulatory constraints.\nAs an example, certain clients may request to receive notifications when research on specific securities is published, and certain clients may request\nthat specific data underlying analysts\'fundamental analysis available on our internal client websites be delivered to them electronically through data\nfeeds or otherwise. No change to an analyst\'s fundamental research views (e.g., ratings, price targets, or material changes to earnings estimatesjfor\nequity securities), will be communicated to any client prior to inclusion of such information in a research report broadly disseminated throuigh electronic\n publication to our internal client websites or through other means, as necessary, to all clients who are entitled to receive such reports.K\nAll research reports are disseminated and available to all clients simultaneously through electronic publication to ourinterhal client websites. Not all\nresearch content is redistributed to our clients or available to third-party aggregators, nor is Goldman Sachs responsible for the redistribution of our\nresearch by third party aggregators. For research, models or other data related to one or more securities/7markets or asset classes (including related\nservices) that may be available to you, please contact your GS representative or go to https://research.gs.com.\nDisclosure information is also available at https:/www.gs.com/research/hedge.html or from Research Compliance, 200 West Street, New York, NY\n10282.\nYou are permitted to store, display, analyze, modify, reformat, and print the information made available to you via this service only for your own use.\nYou may not resell or reverse engineer this informatioh to calculate or develop any index for disclosure and/or marketing or create any other derivative\nworks or commercial product(s), data or offering(s) without the express written consent of Goldman Sachs. You are not permitted to publish, transmit,\nor otherwise reproduce this information, in whole or in part, in any format to any third party without the express written consent of Goldman Sachs.\nThis foregoing restriction incluides, without limitation, using, extracting, downloading or retrieving this information, in whole or in part, to train or\nfinetune a third-party machine learning or artificial intelligence system, or to provide or reproduce this information, in whole or in part, as a prompt or\ninputtoanysuchsystem.\n')
Install the required third-party libraries.
!pip install -U -q langchain-qdrant
Import the necessary classes and functions for the example.
from qdrant_client.http.models import Distance, VectorParams
from langchain_huggingface import HuggingFaceEmbeddings
from langchain_qdrant import QdrantVectorStore
from langchain_openai import OpenAIEmbeddings
from qdrant_client import QdrantClient
Create a model object for BAAI/bge-m3 from Hugging Face.
model_name = "BAAI/bge-m3"
model_kwargs = {'device': 'cpu'}
encode_kwargs = {'normalize_embeddings': False}
embedding = HuggingFaceEmbeddings(
model_name=model_name,
model_kwargs=model_kwargs,
encode_kwargs=encode_kwargs
)
Steps for using Qdrant:
Create an in-memory Qdrant client object.
Create a Qdrant client collection.
Generate a vector store object based on the Qdrant client.
client = QdrantClient(":memory:")
client.create_collection(
collection_name="collection",
vectors_config=VectorParams(size=1024, distance=Distance.COSINE)
)
vector_store = QdrantVectorStore(
client=client,
collection_name="collection",
embedding=embedding,
)
Splitting a LangChain Document object using the RecursiveCharacterTextSplitter class.
from langchain.text_splitter import RecursiveCharacterTextSplitter
text_splitter = RecursiveCharacterTextSplitter(chunk_size=200, chunk_overlap=20)
docs = text_splitter.split_documents([lc_document])
Add the split text chunks to the vector store.
from uuid import uuid4
ids = [str(uuid4()) for _ in range(len(docs))]
vector_store.add_documents(documents=docs, ids=ids)
['ca1cf787-e046-497d-a33c-96b8422ba58f',
'f4648dac-22ce-484c-9782-3a167d3a782d',
'96e6ba35-001e-4078-9775-fc0e0f307c81',
'e4b75bd3-3536-4d90-a4e7-f4eb36573cbb',
'c30f0413-995f-4edd-bb0b-0f00dcc844f7',
'eecb42a2-4df7-41a3-a7d8-549556e36d97',
'f9d08e04-1d1c-4d0f-b1be-218b223572d2',
'6d1c9815-f988-4bb7-95a6-f75052e2ddc3',
'feebd3c1-cb7b-48f1-add4-8b3b8a1cadda',
'5c77338f-4e24-4c0a-b8dd-f77101babc42',
'061d5ced-d155-4b23-ad23-d67675f04cba',
'8feb625e-431f-4789-9579-141cd081951c',
'1d92f5f4-6ae6-4933-b771-8d7dcee7b07c',
'0eededae-ffb9-4bef-98ec-ff79aceb8ad7',
'809731f0-7b68-4825-b76f-087b3ccdbf69',
'48edd14e-6d89-49c4-9679-52f0c138dba7',
'1456a054-ec8a-4650-b5fe-1bd038bdef1c',
'9facc180-a201-41ac-84f0-e115926188c0',
'22e9f280-9bd7-40dc-bcf7-038852c7a2a4',
'0b42bd36-60e0-4b0b-97e8-9e946652034a',
'1f31c928-7dcb-4bb1-9c3c-625d2842f127',
'a94947f0-81e5-430e-be89-d7ea5a224fcc',
'11ff6ad2-4eb0-4da5-a758-414aad9e522c',
'fb8e4890-e446-4d49-8678-2cd3cb969172',
'df044170-af84-424a-9346-c77f4a76219c',
'5b93d7b3-15d0-46c8-b1d6-aeeae21fc6c8',
'639bcbaf-9a65-4237-badb-16d47a5837f3',
'3896fd22-093c-4e5a-90b0-cb7ed3731a27',
'a40f00c3-44ff-4ff5-ac8c-1a05cba71c12',
'0b9d8c3d-3bf5-4427-897b-535b8699fc70',
'e7c1e9b8-c558-43be-b933-e8f149544fb8',
'15c7b6e3-1278-4839-8ec9-c11261ece94e',
'2f66ce7d-cde0-40dd-ae28-9341cac86139',
'11fa353a-dd58-4d66-851e-a3523802727a',
'c45e19c4-2e89-49d3-9a71-6a5ea0b14647',
'5cac36cb-985f-42dd-827b-3cd1cd281482',
'fea0e5ac-3a71-4088-aa15-ba405a399b36',
'360b877c-bba6-4067-a1d3-a9d31112a607',
'5fd7b13f-7813-4a0f-b5a6-261db527b509',
'412ee0b5-e508-4862-8be5-87e7085adff5',
'97e30adc-b119-4c71-8efc-3d92acdeb1dc',
'5dc0677b-1318-41a8-afc1-cc519cfb2655',
'3e571dc6-ce18-4586-9e6a-673659ee1acb',
'39a69a7f-f670-4a47-8f6c-38046c0e5646',
'69b8d443-17b0-46a3-a1ff-55db5d306a29',
'587982e7-b4a0-41c1-86d6-c5de7b9a4972',
'5d7bce4f-3070-4963-b754-13f773253cf3',
'd6ac5b05-a53f-4e2a-b706-fdb635ce342f',
'f01e8c2c-cf7d-4fd7-aaf4-5c92d3767870',
'31fe3a61-960c-4cd4-a9a7-c5d5e213158c',
'217299ce-c15d-4370-b426-226563c8fe0f',
'd48f6d7e-8d84-4f83-9c1b-682fd185234a',
'a428fbe8-8b35-43e2-971c-8334b2558537',
'75b2df47-7511-406c-b44c-e20a5db93cb0',
'1222798d-99bf-4083-8eb6-bb7ce03e8f66',
'6e3861ea-4723-4f1d-8715-514ad02cb357',
'3ef002d1-288a-4469-9c1b-6854811ae7ba',
'113ac076-bd99-4801-85b7-caddcbcbf7f2',
'266ce754-9622-4f25-afc9-4ba132bcea4c',
'57fc8f30-1e3b-4c56-920a-ef337bed82ce',
'4130fc30-1a11-42f8-8f53-61238587d7cc',
'9f24e6a5-3f00-4b16-bc51-1cbc006e8255',
'0e4d9e48-5067-40c9-8b52-dae2cad81be0',
'f670ada8-c097-45da-ba94-971367cc616c',
'cad6be5f-3c92-4bba-9d3c-8cd23660a7d9',
'04d50c0e-acbc-458f-868e-87219ed445b8',
'a0597364-437b-46e4-93e1-6d8319757310',
'ca3cf114-535d-432a-bdbc-231c73df31bb',
'64032a20-5f4a-469d-983a-b275fcf5c418',
'256150da-abd6-4135-a2ae-ae7cfcc629a2',
'23e3ee4a-3fcd-4680-8509-a40443db8e78',
'038fd130-e25e-48ca-8e46-4d5c60616305',
'69cda834-8dbb-4217-ad69-d9feaf76c427',
'6cb59a12-56cb-4a6d-9c60-08fa3687eae6',
'8c99c00f-e387-4320-afd5-b273a5d1045d',
'8141e8bd-f071-4855-a14f-1a8846515134',
'f9fb8631-6026-4f57-a02f-b09ace925886',
'42642928-2f11-4a9e-883e-a6b6e736fec6',
'5916ea7a-2226-44fb-a5f4-96109a28869c',
'e07570ef-c0e0-4412-9c40-f8af9b0af4ef',
'b5058b36-7652-4ad9-96e4-1625d89c9b8a',
'5f37669b-40ca-4977-a480-f6fe2e59f16f',
'8554e106-3aa4-408a-be14-e9de9990c707',
'4225d4df-6a5b-4b18-8971-cfc98b503a1d',
'f207bd71-e246-4114-820f-87aa8aa3cb0d',
'77fe550a-e55b-4d21-81cd-d740b205a7b3',
'1912935a-74de-4503-8c16-01d5e488d02f',
'1e7727c8-beb7-496a-9058-0f6d98a843ea',
'f800213f-41b5-4500-9c7d-245d7c07853e',
'0e76b126-714a-4a55-abd3-dc082083effe',
'cc9fb6ba-4dda-48b7-9d27-08f9c74b010d',
'5e54624b-5921-404c-9ec8-4c1864bac20e',
'5cd2b5fe-5c55-4448-8a73-d89f6d686f81',
'5548b7f5-b5f7-4cdc-bb64-1c4d2c3eba6d',
'cc8897b4-295f-4398-9f24-79160a698afb',
'c3ac050c-c221-4616-905f-1e9bb1325b07',
'5e07669d-4ca8-42a3-b425-06250463bc85',
'20192ffd-e92e-4816-a89f-8208c24da3ec',
'649da785-b86a-4e96-8193-e355e3e41fa0',
'4d5d5416-be3b-473e-b475-16e4487478a7',
'ad3c1497-3610-4e8c-a3ba-7e434d18e70d',
'720c48fb-5d8d-4e40-bc31-d3c5b68f24f5',
'19947425-47e0-4c58-93b0-331f160dcbf0',
'03c12880-914f-4fcb-9879-52577b47706e',
'9dd8c242-040b-4b5b-b789-11da2e1e1ac6',
'af0a09b1-d41e-4bb8-9bfb-0240359ecb36',
'957b35c7-15b5-4de5-ac30-982821442454',
'6727e31d-225a-4046-9f8c-66f06b373e9b',
'6a205997-d5f7-4b12-b4a6-3825c696f0f5',
'65d05dc4-d6dc-4648-b87f-c74399d846b5',
'655262a2-6720-4c07-8faa-16563e590a53',
'7b9cc812-9b62-4e8f-9a6e-cf6309cee7db',
'cc926964-8aac-45c6-adfa-8e2a784809dc',
'74c47651-d442-4b22-858e-1a4f0597c9ea',
'd4b50348-70e6-4b56-a196-8eaac73b7779',
'f83ed084-ebeb-4c79-a509-46f3e69c15b8',
'f07dddb9-18db-471f-8340-54b89a123ed7',
'e31e0371-c4d4-4079-a936-a02943022604',
'08bc8c7a-2d2b-466a-b8a6-1092b886dec1',
'2e7015d0-08b4-4258-bd44-00856aafd6be',
'1498c6f4-2f2b-4f72-9242-3d8ae6cc5ea2',
'9f41aafa-40bf-4dd2-8ced-54f6719d1d54',
'426f75f5-00de-4987-bd79-cbc53601e0ad',
'8c71b15b-17da-4f3c-b735-4529fe5e7e37',
'9b4c3136-5d1e-4d57-9f39-b2fef7984e22',
'3324d48f-ae86-41b6-8cd9-27bf25d4f401',
'8586f5c6-e78d-46c7-bfc9-f8cc2ae536bf',
'f4aba215-2fd7-48e0-b93c-2e117b870187',
'314c3420-a2b9-4e00-be6b-3600843131ec',
'f88b95bd-101c-43d0-a5f4-7ec8a1a3e152',
'fdd1a0b1-1be2-4497-9c8d-aa72dc7efce7',
'33ccd0fd-f084-4a2b-a9b9-bdf087966fe9',
'a0e87eda-a8cc-4eea-a52f-f63f23395745',
'cef9ad24-e0d2-4dd8-8343-b0247246b85a',
'9289fa4f-7705-49c8-8b0a-b37a5a57f6af',
'03e0f6b4-af7e-421e-ad7c-c1892ddf7405',
'a19683d1-16ba-4595-b7e3-7208453b2242',
'a18d23e5-f338-4684-bd5c-01e8c2247715',
'4cbb689c-9e4f-42a0-94e3-d0e2c1ece461',
'9648b33d-8797-4f1b-9297-549f17fc81fa',
'cf45272f-5ad7-41d3-9bb1-46ef31749e67',
'49449963-e941-49a6-9576-7f32df77dc07',
'1816aaab-d746-4f07-8207-5dd5ddaf340a',
'4ebce6a9-45f6-43cd-afd3-18160ae4a6f9',
'a6f95a3e-a7a4-4127-91c4-b6b69e5bc431',
'38144a68-0ff7-40da-b615-dd386180b94c',
'fc13cf4f-d046-4253-9d3f-582c1e436838',
'35834b3f-67b2-4a4f-a92a-01dd62ce16f9',
'5803045e-bb53-43ac-903b-66b1327eb828',
'12eb535d-387d-4b16-a916-fb74364984ad',
'f25bb7e5-c9ed-4f40-a304-79b5418fb830',
'dbf8a07c-e3aa-42a7-bbf3-21260b6c3f00',
'bd57f034-21a1-4f3f-a6a6-dbf09968d5b9',
'c7ecb420-979f-4eaa-9e57-fefab7bfd09f',
'420300cf-f73e-4f28-8ec1-1385e679957a',
'6611ad51-1ef6-4fff-9cad-72a8a3cf8530',
'195fcefc-2996-4f74-9b70-6e0c06c76943',
'99c3a9d1-5c7c-4c6c-bce1-0e0b86c2e3bf',
'5dafb85f-cce0-4f8b-9393-cefccaa32b64',
'da9596f3-13ea-42d9-a23c-3fe23c0be197',
'69f619b1-6470-4180-a31d-421b49664cbb',
'ebc1a74e-56e2-4e78-aac7-b32e2efc4674',
'137edac0-c086-4a52-9d44-87b4a59a37e0',
'9e9a4a3b-c968-4235-a6d9-92cd50c12de3',
'253e59cf-e79f-49c7-814c-c0fd507d583a',
'd40d527f-609f-449f-9ea2-240de40d4559',
'2a3fc09d-9d3f-4533-9903-85c3d8a5284b',
'0ab4de4c-fbcd-4849-a431-a29214873be6',
'1bfbf6e9-6598-416f-ad3a-e285a73d6d59',
'd37620f4-b357-47f0-97d0-8710708800db',
'586f1377-9aeb-4bcb-af72-41b2eb0df93f',
'c45a0ba3-4e39-42fa-b043-0888647ef15c',
'f4834458-0e59-4d66-8349-297e410631e4',
'6d7cc195-77d9-4b07-a5fb-3bd194fe5302',
'00e37182-a15d-479a-aec3-5529e94b98d8',
'5a4708db-1867-4fab-8090-f83643298567',
'9d58ac7a-cef9-4c7b-b43d-6ba1f026339b',
'863aa524-e8d5-4d4e-a21f-fda7ce82383d',
'1eecd29c-09bc-40c2-9b09-908b44e3d0c3',
'41368122-7684-461f-a16b-86a8694db6fc',
'cd4ccb19-aa5f-46a8-9bf7-61311bb0b077',
'75c02f44-c598-455c-98c7-aaf40e400ec6',
'6944410c-767d-46af-83c6-77f69fcd52fd',
'b50412e3-81ac-43f2-ae30-883ecd04b69f',
'f683f2f2-f9eb-44f3-958c-fedbe190f7c7',
'ca02ee03-de1a-479c-a355-120b4ce97875',
'f2a2a285-8e42-4917-8253-18de70e758b6',
'b5085910-b3f6-498d-ab66-282b7753d1b6',
'0bc936c9-d383-4863-a4ef-1138469fe634',
'38c9a344-20ef-4c6d-b764-92c3263afaaf',
'81175e68-32a1-4ae7-9f24-4ddcb64250ec',
'66f4199e-6819-4c9b-8147-78e254827315']
Query the vector store.
query="All eyes are on the July policy meetings."
results = vector_store.similarity_search(query=query, k=1)
for doc in results:
print(f"* {doc.page_content} [{doc.metadata}]")
* 3.All eyes are on the July policy meetings. July will be a hectic month for China
policy watchers: The Third Plenum of the Chinese Communist Party is scheduled for July [{'source': '_v26_1d8c9bc374114b6e901da.pdf_[text]', '_id': 'f9d08e04-1d1c-4d0f-b1be-218b223572d2', '_collection_name': 'collection'}]