1  Parser Usage

Author

Hew Li Yang

Published

July 14, 2024

1.1 Imports

import logging
import random
from pathlib import Path

logging.basicConfig(level=logging.DEBUG)

file = Path("../data/ppms/pme/4.3_PME - PPM.pdf")
file
PosixPath('../data/ppms/pme/4.3_PME - PPM.pdf')

1.2 Using the Parser

Both an async and sync client is provided.

The important arguments you can pass to the clients are:

Parameter Type Description
handle_images bool If False, images are ignored
keep_images bool Images will be written temporarily and cleaned up at the end. If you would like to keep them on disk, perhaps to upload to blob storage, set this to True
image_dpi int Pixel density of the extracted images
min_image_size int Number of pixels in the image for it to be considered. Defaults to 150000
min_vg_size int Size of vector graphic for it to be considered an image. Defaults to 25000
max_concurrent/max_workers int Upper bound on the number of concurrent requests sent to external services

1.2.1 Async

AsyncParser uses asyncio to process the files concurrently. asyncio.Semaphore is used for limiting the number of concurrent HTTP calls to Claude at one time to avoid exceeding rate limits.

from core.parse import AsyncParser

aparser = AsyncParser(
    handle_images=True,
    keep_images=True,
    image_dpi=300,
    min_image_size=150_000,
    min_vg_size=25_000,
    max_concurrent=2,
    llm_kwargs=dict(temperature=0.3),
)
DEBUG:httpx:load_ssl_context verify=True cert=None trust_env=True http2=False
DEBUG:httpx:load_verify_locations cafile='/home/hewliyang/brightriver-clear-core/.venv/lib/python3.11/site-packages/certifi/cacert.pem'
DEBUG:httpx:load_ssl_context verify=True cert=None trust_env=True http2=False
DEBUG:httpx:load_verify_locations cafile='/home/hewliyang/brightriver-clear-core/.venv/lib/python3.11/site-packages/certifi/cacert.pem'
DEBUG:instructor:Patching `client.chat.completions.create` with mode=<Mode.ANTHROPIC_TOOLS: 'anthropic_tools'>
doc = await aparser.parse_file(file)
DEBUG:core.parse.async_parser:0 images in 4.3_PME - PPM.pdf
# preview a random page
doc.pages[random.randint(0, doc.page_count)]

In addition, co-investments will not necessarily be made on the same terms as the Fund’s investment in any portfolio company. For example, distributions of income and proceeds related to each co-investment may be made separately from, and not aggregated with, distributions related to the Fund’s corresponding investment. Co-investors participating in a co-investment may pay no management fees or carried interest in connection with the co-investment or, in the case of Limited Partners who are co-investors, may pay management fees or carried interest at a lower or higher rate as compared to what is paid with respect to investments in the Fund. Transaction fees received by the General Partner with respect to a co-investor may not offset the management fee paid by the Fund to the General Partner. Moreover, certain co-investors may not bear any transaction cost of co-investments that are not consummated or may not be subject to the same risks to which the Fund is subject throughout the investment process. In sum, awarding a coinvestment opportunity to a co-investor generally may afford it proportionately greater exposure to a particular investment at a proportionately lower cost. In addition, co-investors may be subject to different liquidity terms as compared to Limited Partners in the Fund or may have the ability to elect whether or not to participate in follow-on investments in the co-investment opportunity.

The General Partner may also offer co-investment opportunities on a systematic basis to certain Limited Partners that make sizable commitments to the Fund or to other persons or for other reasons, and may for administrative convenience or otherwise form co-investment vehicles for this purpose. The exercise of such co-investment rights may limit the amount of the investment opportunity available to the Fund and may limit the amount of co-investment opportunities available to other potential co-investors.

In addition, the General Partner may offer co-investment opportunities to its consultants, service providers and certain entrepreneurs and experienced operational professionals in the portfolio companies for which such consultant, service provider, entrepreneur or experienced operational professional provides services. The size of such co-investment opportunities will depend, in part, on the level of participation in respect of sourcing, evaluating and negotiating a particular portfolio investment.

Performance-Based Allocation

The existence of performance-based allocation (such as carried interest) payable to a Special Limited Partner or its affiliate may create an incentive for the General Partner to make riskier or more speculative investments on behalf of the Fund, or to take, or not take, certain actions with respect to underperforming or non-performing portfolio investments, than it would otherwise make in the absence of such performance-based allocation. The General Partner will address potential conflicts resulting from this allocation arrangement by focusing on long-term relationships with the Limited Partners and by managing the Fund in accordance with the Partnership Agreement.

Time and Attention of Management Personnel

The success of the Fund will depend substantially on the ability of the investment team members to, among other things, devote such time and effort to the activities of the Fund. Conflicts may arise in the allocation of management and personnel resources. In the event that any of such persons ceases to be actively involved in the Fund, Limited Partners will be required to rely on the

55


1.2.2 Sync

The synchronous client behaves exactly the same way. However, threading is used instead to run I/O blocking tasks concurrently.

from core.parse import Parser

parser = Parser(handle_images=False, keep_images=False, max_workers=2)
parser.parse_file(
    file, pages=[0, 1, 2, 3, 4]
)  # you can also pass in a subset of pages (0-indexed) to parse instead
DEBUG:httpx:load_ssl_context verify=True cert=None trust_env=True http2=False
DEBUG:httpx:load_verify_locations cafile='/home/hewliyang/brightriver-clear-core/.venv/lib/python3.11/site-packages/certifi/cacert.pem'
DEBUG:httpx:load_ssl_context verify=True cert=None trust_env=True http2=False
DEBUG:httpx:load_verify_locations cafile='/home/hewliyang/brightriver-clear-core/.venv/lib/python3.11/site-packages/certifi/cacert.pem'
DEBUG:instructor:Patching `client.chat.completions.create` with mode=<Mode.ANTHROPIC_TOOLS: 'anthropic_tools'>
DEBUG:core.parse.parser:0 images in 4.3_PME - PPM.pdf
Document(pages=[Page(text='**PRIVATE AND CONFIDENTIAL**\n\n# PRIVATE PLACEMENT MEMORANDUM\n\n### Relating to the Limited Partnership Interests in\n\n## PRIMEMOVERS EQUITY FUND I LP\n\n October 2022\n\n\n-----\n\n', page_number=1, toc_items=[], tables=[], images=[], graphics=[]), Page(text='**PRIMEMOVERS EQUITY FUND I LP**\n\n**US$500,000,000**\n\n**LIMITED PARTNERSHIP INTERESTS**\n\nTHIS CONFIDENTIAL PRIVATE PLACEMENT MEMORANDUM (THIS\n\n“ **MEMORANDUM** ”) HAS BEEN PREPARED SOLELY FOR USE BY THE PROSPECTIVE\nINVESTORS OF PRIMEMOVERS EQUITY FUND I LP (THE “ **FUND** ”), AN EXEMPTED\nLIMITED PARTNERSHIP ESTABLISHED UNDER THE LAWS OF THE CAYMAN\nISLANDS. IF THERE IS INVESTOR INTEREST AND APPROPRIATE, ONE OR MORE\nSINGAPORE VEHICLE(S) (EACH, A “ **SINGAPORE VEHICLE** ”) MAY BE FORMED TO\nACCOMMODATE THE INVESTMENT AND REGULATORY REQUIREMENTS OF\nCERTAIN SINGAPORE-BASED AND OTHER INVESTORS. THE FUND MAY INVEST\nALL OR A PORTION OF ITS ASSETS, THROUGH A “MASTER-FEEDER” FUND\nSTRUCTURE IN THE SINGAPORE VEHICLE(S) OR OTHERWISE. THIS MEMORANDUM\nSHALL BE MAINTAINED IN STRICT CONFIDENCE. THE FUND ACTS THROUGH ITS\nGENERAL PARTNER, PRIMEMOVERS EQUITY FUND I GP LIMITED (THE “ **GENERAL**\n**PARTNER** ”), AN EXEMPTED COMPANY INCORPORATED WITH LIMITED LIABILITY\nUNDER THE LAWS OF THE CAYMAN ISLANDS. BY ACCEPTING DELIVERY OF THIS\nMEMORANDUM, EACH RECIPIENT HEREOF ACKNOWLEDGES AND AGREES THAT\n(I) THE CONTENTS OF THIS MEMORANDUM CONSTITUTE PROPRIETARY AND\nCONFIDENTIAL INFORMATION, (II) THE GENERAL PARTNER AND ITS AFFILIATES\n(COLLECTIVELY, “ **PME** ”) DERIVE INDEPENDENT ECONOMIC VALUE FROM NOT\nBEING GENERALLY KNOWN AND ARE THE SUBJECT OF REASONABLE EFFORTS TO\nMAINTAIN THEIR SECRECY AND (III) THE CONTENTS OF THIS MEMORANDUM ARE\nA TRADE SECRET, THE DISCLOSURE OF WHICH IS LIKELY TO CAUSE SUBSTANTIAL\nAND IRREPARABLE COMPETITIVE HARM TO PME. THE RECIPIENT FURTHER\nAGREES (I) NOT TO REPRODUCE OR DISTRIBUTE THIS MEMORANDUM, IN WHOLE\nOR IN PART, OR DISCLOSE ITS CONTENTS, WITHOUT THE PRIOR WRITTEN\nCONSENT OF PME, (II) TO RETURN THIS MEMORANDUM TO PME IMMEDIATELY\nUPON REQUEST, (III) TO KEEP CONFIDENTIAL THE EXISTENCE AND NATURE OF\nALL CONVERSATIONS REGARDING THE FUND AND THIS OFFERING AND (IV) TO BE\nRESPONSIBLE FOR ANY DISCLOSURE OF THIS MEMORANDUM, OR THE\nINFORMATION CONTAINED HEREIN, BY SUCH PERSON OR ANY OF ITS EMPLOYEES,\nAGENTS OR REPRESENTATIVES.\n\nTHIS MEMORANDUM HAS BEEN PREPARED IN CONNECTION WITH A PRIVATE\nOFFERING TO A LIMITED NUMBER OF SOPHISTICATED PROSPECTIVE INVESTORS\nOF NON-REDEEMABLE LIMITED PARTNERSHIP INTERESTS (THE “ **INTERESTS** ”) IN\nTHE FUND. EACH INVESTOR INVESTING IN THE FUND WILL BE REQUIRED TO\nEXECUTE THE AMENDED AND RESTATED EXEMPTED LIMITED PARTNERSHIP\nAGREEMENT(S) OF THE FUND (THE “ **PARTNERSHIP AGREEMENT** ”), THE\nSUBSCRIPTION AGREEMENT AND INVESTOR QUESTIONNAIRE OF THE FUND (THE\n“ **SUBSCRIPTION AGREEMENT** ”) AND CERTAIN OTHER RELATED DOCUMENTS OF\nTHE FUND TO EFFECT THE INVESTMENT, AS APPLICABLE. THIS MEMORANDUM\nCONTAINS A SUMMARY OF THE PARTNERSHIP AGREEMENT. HOWEVER, THE\n\n\n-----\n\n', page_number=2, toc_items=[], tables=[], images=[], graphics=[]), Page(text='SUMMARY SET FORTH IN THIS MEMORANDUM DOES NOT PURPORT TO BE\nCOMPLETE AND IS SUBJECT TO AND QUALIFIED IN ITS ENTIRETY BY REFERENCE\nTO THE PARTNERSHIP AGREEMENT. IN THE EVENT THAT THE DESCRIPTIONS IN\nOR TERMS OF THIS MEMORANDUM ARE INCONSISTENT WITH OR CONTRARY TO\nTHE PARTNERSHIP AGREEMENT, THE PARTNERSHIP AGREEMENT SHALL\nCONTROL.\n\nTHE INTERESTS HAVE NOT BEEN REGISTERED UNDER THE U.S. SECURITIES ACT\nOF 1933, AS AMENDED (THE “ **ACT** ”), OR ANY U.S. FEDERAL OR STATE SECURITIES\nLAWS OR THE SECURITIES LAWS OF ANY FOREIGN JURISDICTION. THE INTERESTS\nWILL BE OFFERED AND SOLD ONLY TO QUALIFYING RECIPIENTS PURSUANT TO\nTHE EXEMPTION FROM THE REGISTRATION REQUIREMENTS OF THE ACT\nPROVIDED BY SECTION 4(2) THEREOF AND REGULATION D OR S PROMULGATED\nTHEREUNDER AND OTHER EXEMPTIONS OF SIMILAR IMPORT IN THE LAWS OF THE\nSTATES AND OTHER JURISDICTIONS WHERE THE OFFERING WILL BE MADE. THE\nFUND WILL NOT BE REGISTERED AS AN INVESTMENT COMPANY UNDER THE\nINVESTMENT COMPANY ACT OF 1940, AS AMENDED (THE “ **INVESTMENT**\n**COMPANY ACT** ”). CONSEQUENTLY, INVESTORS WILL NOT BE AFFORDED THE\nPROTECTIONS OF THE INVESTMENT COMPANY ACT. THERE WILL BE NO PUBLIC\nMARKET FOR THE INTERESTS AND THERE IS NO OBLIGATION ON THE PART OF\nANY PERSON TO REGISTER THE INTERESTS UNDER THE ACT OR ANY STATE OR\nNON-U.S. SECURITIES LAWS.\n\nTHE FUND IS REQUIRED TO REGISTER AS A PRIVATE FUND UNDER THE PRIVATE\nFUNDS ACT (AS AMENDED) OF THE CAYMAN ISLANDS (THE “ **PRIVATE FUNDS**\n**ACT** ”). THE REGISTRATION OF A FUND BY THE CAYMAN ISLANDS MONETARY\nAUTHORITY (THE “ **MONETARY AUTHORITY** ”) DOES NOT CONSTITUTE ANY\nGUARANTEE OR ASSURANCE BY THE MONETARY AUTHORITY TO ANY INVESTOR\nAS TO THE PERFORMANCE OR CREDITWORTHINESS OF THE FUND. FURTHERMORE,\nIN REGISTERING A FUND, THE MONETARY AUTHORITY SHALL NOT BE LIABLE FOR\nANY LOSSES OR DEFAULT OF THE FUND OR FOR THE CORRECTNESS OF ANY\nOPINIONS OR STATEMENTS EXPRESSED IN ANY MATERIAL USED TO SOLICIT THE\nPURCHASE OF INVESTMENT INTERESTS IN A FUND. NEITHER THE MONETARY\nAUTHORITY NOR ANY OTHER GOVERNMENTAL AUTHORITY IN THE CAYMAN\nISLANDS HAS COMMENTED UPON OR APPROVED THE TERMS OR MERITS OF THIS\nMEMORANDUM. THERE IS NO INVESTMENT COMPENSATION SCHEME AVAILABLE\nTO INVESTORS IN THE CAYMAN ISLANDS.\n\nTHE INTERESTS MAY ONLY BE ACQUIRED FOR INVESTMENT AND WITHOUT A\nVIEW TO DISTRIBUTION. THE INTERESTS DESCRIBED IN THIS MEMORANDUM ARE\nSUBJECT TO RESTRICTIONS ON TRANSFERABILITY AND RESALE AND MAY NOT BE\nTRANSFERRED, RESOLD, ASSIGNED, PLEDGED, HYPOTHECATED OR DISPOSED\nEXCEPT AS PERMITTED UNDER THE ACT AND APPLICABLE STATE AND NON-U.S.\nSECURITIES LAWS, PURSUANT TO REGISTRATION OR EXEMPTION THEREFROM. IN\nADDITION, SUCH INTERESTS MAY NOT BE SOLD, TRANSFERRED, ASSIGNED OR\nHYPOTHECATED, IN WHOLE OR IN PART, EXCEPT AS PROVIDED IN THE\nPARTNERSHIP AGREEMENT. INVESTORS SHOULD BE AWARE THAT THEY WILL BE\n\n\n-----\n\n', page_number=3, toc_items=[], tables=[], images=[], graphics=[]), Page(text='REQUIRED TO BEAR THE FINANCIAL RISKS OF THIS INVESTMENT FOR AN\nINDEFINITE PERIOD OF TIME.\n\nANY TRANSFEREE OF THE INTERESTS OR ANY INTEREST OR PARTICIPATION\nTHEREIN, BY ITS ACCEPTANCE THEREOF, SHALL BE DEEMED TO HAVE MADE THE\nREPRESENTATIONS SET FORTH IN THE SUBSCRIPTION AGREEMENT. THE FUND\nSHALL NOT BE REQUIRED TO REGISTER THE TRANSFER OF ANY INTEREST TO ANY\nPERSON UNLESS SUCH TRANSFER IS IN ACCORDANCE WITH THE PARTNERSHIP\nAGREEMENT AND THE FUND RECEIVES FROM THE PROPOSED TRANSFEREE A\nWRITTEN INSTRUMENT IN FORM AND SUBSTANCE REASONABLY SATISFACTORY\nTO THE FUND IN WHICH SUCH TRANSFEREE MAKES THE REPRESENTATIONS AND\nWARRANTIES SET FORTH IN THE SUBSCRIPTION AGREEMENT AND, IF THE FUND\nSO REQUESTS, AN OPINION OF COUNSEL IN FORM AND SUBSTANCE REASONABLY\nSATISFACTORY TO THE PARTNERSHIP TO THE EFFECT THAT REGISTRATION\nUNDER THE SECURITIES ACT IS NOT REQUIRED IN CONNECTION WITH SUCH\nTRANSFER.\n\nNO PERSON HAS BEEN AUTHORIZED TO MAKE ANY STATEMENT CONCERNING\nTHE FUND OR THE SALE OF INTERESTS DISCUSSED HEREIN OTHER THAN AS SET\nFORTH IN THIS MEMORANDUM AND ANY SUCH STATEMENTS, IF MADE, MUST NOT\nBE RELIED UPON AS HAVING BEEN AUTHORIZED BY PME. EACH PROSPECTIVE\nINVESTOR IS INVITED TO MEET WITH REPRESENTATIVES OF THE FUND AND TO\nDISCUSS WITH, ASK QUESTIONS OF AND RECEIVE ANSWERS FROM SUCH\nREPRESENTATIVES CONCERNING THE TERMS AND CONDITIONS OF THE OFFERING\nOF THE INTERESTS, AND TO OBTAIN ANY ADDITIONAL INFORMATION (TO THE\nEXTENT THAT SUCH REPRESENTATIVES POSSESS SUCH INFORMATION OR CAN\nACQUIRE IT WITHOUT UNREASONABLE EFFORT OR EXPENSE) NECESSARY TO\nVERIFY THE INFORMATION CONTAINED HEREIN.\n\nPROSPECTIVE INVESTORS MAY BE GIVEN ACCESS TO INFORMATION ABOUT THE\nPRIOR INVESTMENT PERFORMANCE OR TRACK RECORD OF CERTAIN MEMBERS\nOF PME’S INVESTMENT TEAM OR OTHER INFORMATION SEPARATE FROM THIS\nMEMORANDUM BY THE ADVISOR, THE CAYMAN INVESTMENT ADVISOR OR THE\nGENERAL PARTNER AND SUCH INFORMATION IS NOT INTENDED TO BE\nINCORPORATED INTO THIS MEMORANDUM.\n\nPROSPECTIVE INVESTORS SHOULD NOT CONSTRUE THE CONTENTS OF THIS\nMEMORANDUM AS LEGAL, TAX, INVESTMENT OR OTHER ADVICE. EACH\nPROSPECTIVE INVESTOR SHOULD MAKE ITS OWN INVESTIGATIONS AND\nEVALUATIONS OF THE FUND, INCLUDING THE MERITS AND RISKS INVOLVED IN\nAN INVESTMENT THEREIN, AND CONSULT ITS ADVISOR AS TO LEGAL, TAX,\nFINANCIAL AND OTHER RELEVANT MATTERS CONCERNING AN INVESTMENT IN\nTHE INTERESTS AND THE SUITABILITY OF THE INVESTMENT FOR SUCH INVESTOR.\nPRIOR TO ANY INVESTMENT, PME WILL GIVE INVESTORS THE OPPORTUNITY TO\nASK QUESTIONS OF, AND RECEIVE ANSWERS AND ADDITIONAL INFORMATION\nFROM, IT CONCERNING THE TERMS AND CONDITIONS OF THIS OFFERING AND\nOTHER RELEVANT MATTERS. INVESTORS SHOULD INFORM THEMSELVES AND\n\n\n-----\n\n', page_number=4, toc_items=[], tables=[], images=[], graphics=[]), Page(text='ARE RESPONSIBLE AS TO THE LEGAL REQUIREMENTS APPLICABLE TO THEM IN\nRESPECT OF THE ACQUISITION, HOLDING AND DISPOSITION OF THE INTERESTS\nAND AS TO THE INCOME AND OTHER TAX CONSIDERATIONS TO THEM OF SUCH\nACQUISITION, HOLDING AND DISPOSITION.\n\nSTATEMENTS IN THIS MEMORANDUM ARE ACCURATE AS OF THE DATE OF THIS\nMEMORANDUM UNLESS OTHERWISE STATED HEREIN, AND NEITHER THE\nDELIVERY OF THIS MEMORANDUM AT ANY TIME, NOR ANY SALE HEREUNDER,\nSHALL UNDER ANY CIRCUMSTANCES CREATE AN IMPLICATION THAT THE\nINFORMATION CONTAINED HEREIN IS CORRECT AS OF ANY TIME SUBSEQUENT TO\nSUCH DATE.\n\nTHE INTERESTS ARE OFFERED SUBJECT TO THE RIGHT OF THE GENERAL PARTNER\nTO REJECT ANY SUBSCRIPTION IN WHOLE OR IN PART. AN INVESTMENT IN THE\nINTERESTS WILL INVOLVE SIGNIFICANT RISKS DUE TO, AMONG OTHER THINGS,\nTHE NATURE OF THE FUND’S STRUCTURE AND INVESTMENTS AND THE NATURE\nOF THE INTERESTS. NO ASSURANCE CAN BE GIVEN THAT THE FUND’S\nINVESTMENT OBJECTIVE WILL BE ACHIEVED OR THAT INVESTORS WILL RECEIVE\nA RETURN OF THEIR CAPITAL. INVESTORS SHOULD HAVE THE FINANCIAL\nABILITY AND WILLINGNESS TO ACCEPT THE HIGH RISK AND LACK OF LIQUIDITY\nTHAT ARE CHARACTERISTIC OF THE INVESTMENT DESCRIBED HEREIN. PME\nRESERVES THE RIGHT TO MODIFY ANY OF THE TERMS OF THE OFFERING AND THE\nINTERESTS DESCRIBED HEREIN.\n\nCERTAIN INFORMATION CONTAINED IN THIS MEMORANDUM CONSTITUTES\n“FORWARD-LOOKING” STATEMENTS OR OPINIONS THAT ARE BASED UPON\nCURRENT EXPECTATIONS, ESTIMATES AND PROJECTIONS ABOUT, INTER ALIA,\nTHE INDUSTRY AND MARKETS IN WHICH THE FUND WILL OPERATE, AS WELL AS\nPME’S BELIEFS AND ASSUMPTIONS MADE BY PME. THESE “FORWARD-LOOKING”\nSTATEMENTS OR OPINIONS CAN BE IDENTIFIED BY THE USE OF FORWARDLOOKING TERMINOLOGY SUCH AS “MAY,” “WILL,” “SHOULD,” “EXPECT,” “SEEK,”\n“ANTICIPATE,” “PROJECT,” “ESTIMATE,” “INTEND,” “CONTINUE” OR “BELIEVE” OR\nTHE NEGATIVES THEREOF OR OTHER VARIATIONS THEREON OR OTHER\nCOMPARABLE TERMINOLOGY. ANY ASSUMPTIONS SHOULD NOT BE CONSTRUED\nTO BE INDICATIVE OF THE ACTUAL EVENTS WHICH WILL OCCUR. ACTUAL\nEVENTS ARE DIFFICULT TO PREDICT AND MAY DEPEND UPON FACTORS THAT ARE\nBEYOND THE FUND’S CONTROL. CERTAIN ASSUMPTIONS HAVE BEEN MADE TO\nSIMPLIFY THE MEMORANDUM. DUE TO VARIOUS RISKS AND UNCERTAINTIES,\nINCLUDING THOSE DESCRIBED IN THIS MEMORANDUM, ACTUAL EVENTS OR\nRESULTS OR THE ACTUAL PERFORMANCE OF THE FUND MAY DIFFER\nMATERIALLY FROM THOSE REFLECTED OR CONTEMPLATED IN SUCH FORWARDLOOKING STATEMENTS. SOME IMPORTANT FACTORS WHICH COULD CAUSE\nACTUAL RESULTS TO DIFFER MATERIALLY FROM THOSE IN ANY FORWARDLOOKING STATEMENTS INCLUDE, WITHOUT LIMITATION, THE FOLLOWING: (I)\nFINANCIAL, MARKET, ECONOMIC OR LEGAL CONDITIONS, (II) FOREIGN\nEXCHANGE DEVELOPMENTS, (III) THE FUND’S INABILITY TO EXECUTE ITS\nINVESTMENT STRATEGY AND/OR (IV) INCREASED COMPETITION OR THE ENTRY\n\n\n-----\n\n', page_number=5, toc_items=[], tables=[], images=[], graphics=[])], file_name='4.3_PME - PPM.pdf', page_count=133, format='PDF 1.7', title='', producer='PDF generator', creationDate="D:20221006224152+08'00'", modDate='D:20230406084247Z')

1.2.3 llama-parse

A light wrapper around llama-parse is also provided. It is up to the user which parser they would like to use.

Note that for llama-parse, page metadata will always be empty as the service does not return any page level metadata.

from core.parse import AsyncBrightriverLlamaParse

# the API is precisely the same the regular LlamaParse object
# presence of a LLAMA_CLOUD_API_KEY is not enforced
# You are responsible for setting it as an environment variable or passing it
# directly into the constructor

llama_parse = AsyncBrightriverLlamaParse()
doc = await llama_parse.parse_file(file)
DEBUG:httpx:load_ssl_context verify=True cert=None trust_env=True http2=False
DEBUG:httpx:load_verify_locations cafile='/home/hewliyang/brightriver-clear-core/.venv/lib/python3.11/site-packages/certifi/cacert.pem'
DEBUG:httpcore.connection:connect_tcp.started host='api.cloud.llamaindex.ai' port=443 local_address=None timeout=2000 socket_options=None
DEBUG:httpcore.connection:connect_tcp.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x7fb46ffb5f10>
DEBUG:httpcore.connection:start_tls.started ssl_context=<ssl.SSLContext object at 0x7fb46fe87f50> server_hostname='api.cloud.llamaindex.ai' timeout=2000
DEBUG:httpcore.connection:start_tls.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x7fb46ffb7fd0>
DEBUG:httpcore.http11:send_request_headers.started request=<Request [b'POST']>
DEBUG:httpcore.http11:send_request_headers.complete
DEBUG:httpcore.http11:send_request_body.started request=<Request [b'POST']>
DEBUG:httpcore.http11:send_request_body.complete
DEBUG:httpcore.http11:receive_response_headers.started request=<Request [b'POST']>
DEBUG:httpcore.http11:receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Fri, 19 Jul 2024 18:13:42 GMT'), (b'Content-Type', b'application/json'), (b'Content-Length', b'64'), (b'Connection', b'keep-alive'), (b'x-session-id', b'b3d9f803-6bbb-4bee-becf-a18adf1ebde0'), (b'x-correlation-id', b'9d39b00f-e45f-47b5-8c88-e0cf9f17c5c3'), (b'Strict-Transport-Security', b'max-age=31536000; includeSubDomains')])
INFO:httpx:HTTP Request: POST https://api.cloud.llamaindex.ai/api/parsing/upload "HTTP/1.1 200 OK"
DEBUG:httpcore.http11:receive_response_body.started request=<Request [b'POST']>
DEBUG:httpcore.http11:receive_response_body.complete
DEBUG:httpcore.http11:response_closed.started
DEBUG:httpcore.http11:response_closed.complete
DEBUG:httpcore.connection:close.started
DEBUG:httpcore.connection:close.complete
Started parsing the file under job_id cac11eca-5f2b-4f27-a789-2567766a9740
DEBUG:httpx:load_ssl_context verify=True cert=None trust_env=True http2=False
DEBUG:httpx:load_verify_locations cafile='/home/hewliyang/brightriver-clear-core/.venv/lib/python3.11/site-packages/certifi/cacert.pem'
DEBUG:httpcore.connection:connect_tcp.started host='api.cloud.llamaindex.ai' port=443 local_address=None timeout=2000 socket_options=None
DEBUG:httpcore.connection:connect_tcp.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x7fb46fc58790>
DEBUG:httpcore.connection:start_tls.started ssl_context=<ssl.SSLContext object at 0x7fb46fc0cb00> server_hostname='api.cloud.llamaindex.ai' timeout=2000
DEBUG:httpcore.connection:start_tls.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x7fb46fc8ff50>
DEBUG:httpcore.http11:send_request_headers.started request=<Request [b'GET']>
DEBUG:httpcore.http11:send_request_headers.complete
DEBUG:httpcore.http11:send_request_body.started request=<Request [b'GET']>
DEBUG:httpcore.http11:send_request_body.complete
DEBUG:httpcore.http11:receive_response_headers.started request=<Request [b'GET']>
DEBUG:httpcore.http11:receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Fri, 19 Jul 2024 18:13:44 GMT'), (b'Content-Type', b'application/json'), (b'Content-Length', b'64'), (b'Connection', b'keep-alive'), (b'x-session-id', b'9076ed9b-6d72-412d-940f-6de8b9b04391'), (b'x-correlation-id', b'a21cab1d-b155-49c5-9794-02c38b4296dd'), (b'Strict-Transport-Security', b'max-age=31536000; includeSubDomains')])
INFO:httpx:HTTP Request: GET https://api.cloud.llamaindex.ai/api/parsing/job/cac11eca-5f2b-4f27-a789-2567766a9740 "HTTP/1.1 200 OK"
DEBUG:httpcore.http11:receive_response_body.started request=<Request [b'GET']>
DEBUG:httpcore.http11:receive_response_body.complete
DEBUG:httpcore.http11:response_closed.started
DEBUG:httpcore.http11:response_closed.complete
DEBUG:httpcore.http11:send_request_headers.started request=<Request [b'GET']>
DEBUG:httpcore.http11:send_request_headers.complete
DEBUG:httpcore.http11:send_request_body.started request=<Request [b'GET']>
DEBUG:httpcore.http11:send_request_body.complete
DEBUG:httpcore.http11:receive_response_headers.started request=<Request [b'GET']>
DEBUG:httpcore.http11:receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Fri, 19 Jul 2024 18:13:44 GMT'), (b'Content-Type', b'application/json'), (b'Content-Length', b'401376'), (b'Connection', b'keep-alive'), (b'x-session-id', b'c79bccd9-af6d-46d8-9da6-bf4808a4a454'), (b'x-correlation-id', b'7e97711b-f871-48d3-9936-3980d97a7849'), (b'Strict-Transport-Security', b'max-age=31536000; includeSubDomains')])
INFO:httpx:HTTP Request: GET https://api.cloud.llamaindex.ai/api/parsing/job/cac11eca-5f2b-4f27-a789-2567766a9740/result/markdown "HTTP/1.1 200 OK"
DEBUG:httpcore.http11:receive_response_body.started request=<Request [b'GET']>
DEBUG:httpcore.http11:receive_response_body.complete
DEBUG:httpcore.http11:response_closed.started
DEBUG:httpcore.http11:response_closed.complete
DEBUG:httpcore.connection:close.started
DEBUG:httpcore.connection:close.complete
# preview a random page
doc.pages[random.randint(0, doc.page_count)]

ESTABLISHED, DOES NOT EXCEED 100% OF THE LIQUIDATION VALUE OF THIS POOL’S PORTFOLIO. THIS EXEMPTION ALSO REQUIRES, AMONG OTHER THINGS, EACH U.S. INVESTOR TO MEET CERTAIN SOPHISTICATION CRITERIA, SUCH AS BEING AN “ACCREDITED INVESTOR” WITHIN THE MEANING OF REGULATION D PROMULGATED UNDER THE SECURITIES ACT OR A “KNOWLEDGEABLE EMPLOYEE” AS SPECIFIED IN THE CFTC REGULATIONS. THEREFORE, UNLIKE A REGISTERED COMMODITY POOL OPERATOR, SHOULD IT CLAIM THE AFOREMENTIONED EXEMPTION, THE GENERAL PARTNER WOULD NOT BE REQUIRED TO DELIVER A DISCLOSURE DOCUMENT OR A CERTIFIED ANNUAL REPORT TO PARTICIPANTS IN THIS POOL.

FOR NON-U.S. RESIDENTS: NO ACTION HAS BEEN OR WILL BE TAKEN IN ANY JURISDICTION OUTSIDE THE UNITED STATES OF AMERICA THAT WOULD PERMIT AN OFFERING OF THE INTERESTS, OR POSSESSION OR DISTRIBUTION OF OFFERING MATERIALS IN CONNECTION WITH THE ISSUANCE OF THESE INTERESTS, IN ANY COUNTRY OR JURISDICTION WHERE ACTION FOR THAT PURPOSE IS REQUIRED. IT IS THE RESPONSIBILITY OF ANY PERSON WISHING TO PURCHASE ANY OF THESE INTERESTS TO SATISFY HIMSELF, HERSELF OR ITSELF AS TO FULL OBSERVANCE OF THE LAWS OR REGULATIONS OF ANY RELEVANT TERRITORY OUTSIDE THE UNITED STATES OF AMERICA IN CONNECTION WITH ANY SUCH PURCHASE, INCLUDING OBTAINING ANY REQUIRED GOVERNMENTAL OR OTHER CONSENTS OR OBSERVING ANY OTHER APPLICABLE FORMALITIES. SELLING RESTRICTIONS APPLICABLE TO CERTAIN INVESTORS ARE INCLUDED IN “CERTAIN OFFERING NOTICES” AT THE END OF THIS MEMORANDUM, AND THE INVESTORS ARE URGED TO REVIEW SUCH DISCLOSURE CAREFULLY.

REFERENCES HEREIN TO THE FUND TAKING A CERTAIN ACTION SHALL, WHEREVER THE CONTEXT REQUIRES, MEAN THE GENERAL PARTNER OF THE FUND TAKING SUCH ACTION (IN ITS CAPACITY AS SUCH) ON ITS BEHALF.

UNLESS OTHERWISE STATED, ALL DOLLAR FIGURES IN THIS MEMORANDUM ARE EXPRESSED IN UNITED STATES DOLLARS AND REFERENCES TO “\(”, “USD” OR “US\)” ARE TO UNITED STATES DOLLARS.

PROSPECTIVE INVESTORS HAVING INQUIRIES WITH RESPECT TO THIS MEMORANDUM SHOULD CONTACT:

PRIMEMOVERS EQUITY (S) PTE. LTD. 13 STAMFORD ROAD #02-11 NO. 18 CAPITOL, SINGAPORE 178905
SOO JIN GOH RANDY TEO
TELEPHONE: +65 9116 1282 TELEPHONE: +65 9616 4484
EMAIL: soojin@primemoversequity.com EMAIL: randyteo@primemoversequity.com

647428.01M-HKGSR01A - MSW

1.3 Saving results

# dump document to JSON
fn = str(file).replace(".pdf", ".json")
with open(fn, "w") as f:
    f.write(doc.model_dump_json(indent=2, by_alias=True))

1.4 Reading from saved file

from IPython.display import HTML

from core.parse import BrightRiverDocument

_doc = BrightRiverDocument.from_json_file(fn)

# show pages with tables
for page in _doc.pages:
    if page.tables:
        display(
            HTML(
                f"<div style='border-style: dotted; padding: 0.25rem; color: green; text-align:center;'>PAGE {page.page_number}</div>"
            )
        )
        display(page)
        display(
            HTML(
                f"<div style='border-style: dotted; padding: 0.25rem; color: green; text-align:center;'>PAGE {page.page_number}</div>"
            )
        )
PAGE 7

ESTABLISHED, DOES NOT EXCEED 100% OF THE LIQUIDATION VALUE OF THIS POOL’S PORTFOLIO. THIS EXEMPTION ALSO REQUIRES, AMONG OTHER THINGS, EACH U.S. INVESTOR TO MEET CERTAIN SOPHISTICATION CRITERIA, SUCH AS BEING AN “ACCREDITED INVESTOR” WITHIN THE MEANING OF REGULATION D PROMULGATED UNDER THE SECURITIES ACT OR A “KNOWLEDGEABLE EMPLOYEE” AS SPECIFIED IN THE CFTC REGULATIONS. THEREFORE, UNLIKE A REGISTERED COMMODITY POOL OPERATOR, SHOULD IT CLAIM THE AFOREMENTIONED EXEMPTION, THE GENERAL PARTNER WOULD NOT BE REQUIRED TO DELIVER A DISCLOSURE DOCUMENT OR A CERTIFIED ANNUAL REPORT TO PARTICIPANTS IN THIS POOL.

FOR NON-U.S. RESIDENTS: NO ACTION HAS BEEN OR WILL BE TAKEN IN ANY JURISDICTION OUTSIDE THE UNITED STATES OF AMERICA THAT WOULD PERMIT AN OFFERING OF THE INTERESTS, OR POSSESSION OR DISTRIBUTION OF OFFERING MATERIALS IN CONNECTION WITH THE ISSUANCE OF THESE INTERESTS, IN ANY COUNTRY OR JURISDICTION WHERE ACTION FOR THAT PURPOSE IS REQUIRED. IT IS THE RESPONSIBILITY OF ANY PERSON WISHING TO PURCHASE ANY OF THESE INTERESTS TO SATISFY HIMSELF, HERSELF OR ITSELF AS TO FULL OBSERVANCE OF THE LAWS OR REGULATIONS OF ANY RELEVANT TERRITORY OUTSIDE THE UNITED STATES OF AMERICA IN CONNECTION WITH ANY SUCH PURCHASE, INCLUDING OBTAINING ANY REQUIRED GOVERNMENTAL OR OTHER CONSENTS OR OBSERVING ANY OTHER APPLICABLE FORMALITIES. SELLING RESTRICTIONS APPLICABLE TO CERTAIN INVESTORS ARE INCLUDED IN “CERTAIN OFFERING NOTICES” AT THE END OF THIS MEMORANDUM, AND THE INVESTORS ARE URGED TO REVIEW SUCH DISCLOSURE CAREFULLY.

REFERENCES HEREIN TO THE FUND TAKING A CERTAIN ACTION SHALL, WHEREVER THE CONTEXT REQUIRES, MEAN THE GENERAL PARTNER OF THE FUND TAKING SUCH ACTION (IN ITS CAPACITY AS SUCH) ON ITS BEHALF.

UNLESS OTHERWISE STATED, ALL DOLLAR FIGURES IN THIS MEMORANDUM ARE EXPRESSED IN UNITED STATES DOLLARS AND REFERENCES TO “\(”, “USD” OR “US\)” ARE TO UNITED STATES DOLLARS.

PROSPECTIVE INVESTORS HAVING INQUIRIES WITH RESPECT TO THIS

MEMORANDUM SHOULD CONTACT:

PRIMEMOVERS EQUITY (S) PTE. LTD.

13 STAMFORD ROAD

#02-11 NO. 18 CAPITOL, SINGAPORE 178905

SOO JIN GOH TELEPHONE: +65 9116 1282 EMAIL: soojin@primemoversequity.com RANDY TEO TELEPHONE: +65 9616 4484 EMAIL: randyteo@primemoversequity.com

PAGE 7
PAGE 10

1.4.1 II. EXECUTIVE SUMMARY OF PRINCIPAL TERMS

The following information is presented only as a summary of the principal terms of PrimeMovers Equity Fund I (the “Fund”) and is qualified in its entirety by reference to the more detailed Section IV – “Summary of Principal Terms” herein, the Partnership Agreement of the Fund, and other constituent documents. In the event of any inconsistency between the terms contained herein and the Partnership Agreement, the Partnership Agreement shall prevail.

Fund: PrimeMovers Equity Fund I
Target Fund Size: US$500 million
Team Commitment: The lesser of 3% of aggregate capital commitments and US$15 million
Investment Period: 5 years, subject to 1 year extension with LP consent
Term: 10 years, subject to 2 consecutive one year extensions with LP consent
Management Fee During the Investment Period, 2% per annum of capital commitments; thereafter, 2% per annum of invested capital
Preferred Return: 8% per annum
Carried Interest: 20%

PAGE 10
# show document metadata
meta = _doc.model_dump(exclude="pages")
meta
{'file_name': '4.3_PME - PPM.pdf',
 'page_count': 133,
 'format': 'PDF 1.7',
 'title': '',
 'producer': 'PDF generator',
 'creationDate': "D:20221006224152+08'00'",
 'modDate': 'D:20230406084247Z'}