Files
Anton_wireframe/app/__pycache__/main.cpython-312.pyc
T

54 lines
5.1 KiB
Plaintext
Raw Normal View History

Ë
e,îhãóBddlZddlZddlmZmZmZddlmZddl m
Z
m Z m Z m
Z
ddlmZddlmZmZmZmZmZmZddlmZmZddlmZdd lmZe«d
Ze«e
«ZGd d e«Z ejCd
«d«Z"ejGddge$e%¬«e d«e d«fdede
de&fd«Z'ejGdeedg¬«de fd«Z(ejSejT«ejSejT«ejSejT«ejSejT«ejSejT«ejSejT«e+dk(rddl,Z,e,jZdddd ¬!«yy)"éN)ÚBaseÚ
db_dependencyÚengine)Ú load_dotenv)ÚFastAPIÚFileÚFormÚ
UploadFile)Ú BaseModel)Ú companiesÚfolk_crmÚ
insight_routeÚ investorsÚprojectsÚ report_route)ÚInvestmentResponseÚPaginatedResponse)ÚInvestorProcessor)ÚQueryProcessorcóLtjjt¬«y)z.Initialize the database by creating all tables)ÚbindN)rÚmetadataÚ
create_allr©óú?/home/oluwasanmi/Documents/Work/MKD/anton_wireframe/app/main.pyÚ
init_databasersä‡MM×Ѥ&ÐÕ)rcó,eZdZUeed<Gdd«Zy)Ú QueryRequestÚquestioncóeZdZdddiiZy)úQueryRequest.ConfigÚexampler zDFind me deep tech investors that do deals in Europe under 5 million.N)Ú__name__Ú
__module__Ú __qualname__Újson_schema_extrarrrÚConfigr"%sà ØÐð
Ñrr(N)r$r%r&ÚstrÚ__annotations__r(rrrrr"s؃M÷
ò
rrú/có
ddiS)HelloÚWorldrrrrÚhealthr/-s
à  Ðrz
/parse-csvz
CSV Upload)ÚtagsÚresponse_model.ÚdbÚfileÚ is_investorcƒóFK|j«ƒd{}tjtj|j d«««}t
«}|dk(r|j|d¬«ƒd{}|S|j|d¬«ƒd{}|S7Œ„7Œ%7Œ
­w)a
Parse and import CSV data into the database.
**For investors:**
- Expected columns: Name, Website, Final Investor Profile, Final Profile sourcing
- Manually parses JSON profiles for efficiency
- Uses LLM only for currency conversion to USD
- Handles AUM, fund sizes, and check sizes as integers
**For companies:**
- Expected columns: Name, Website, Investor, Final Investor Profile (company profile)
- 100% manual JSON parsing - no LLM needed
- Extracts company details, executives, investors, and client categories
- Automatically links companies to investors in database
**Benefits:**
- Fast processing (5-10s per record)
- Low cost (minimal or no LLM usage)
- Accurate data extraction
- Automatic database persistence
Nzutf-8éT)Ú
save_to_db) ÚreadÚpdÚread_csvÚioÚStringIOÚdecoderÚparse_investorsÚparse_companies)r2r3r4ÚcontentÚdfÚ processorÚresultss rÚ parse_csvrD2s—èø€ð4—I‘I“K×€GÜ ”R—[‘[ §¡°Ó!8Ó9Ó :€Bô#€Iàà!×1°"ÀÐF×Fˆàˆð"×1°"ÀÐàˆð øðGøð
Gús4B!B—A B!Á7BÁ8B!ÂBÂB!ÂB!ÂB!z/queryÚQuerying)r1r0ÚrequestcƒóXKt«}|j|j«}|S­w)
Query investors using natural language.
Returns fund-level matches (one row per fund) with investor details.
This ensures only relevant funds are included in the response.
Supports queries like:
- "Show me seed stage investors"