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

71 lines
6.5 KiB
Plaintext
Raw Normal View History

Ë
2025-10-28 21:09:47 +01:00
Ç"ipãó¨ddlZddlZddlmZmZmZddlmZddl m
Z
2025-10-28 21:09:47 +01:00
m Z m Z m
Z
ddlmZddlmZmZmZmZmZmZddlmZmZmZddlmZdd lmZdd
2025-10-28 20:54:15 +01:00
lm Z e«d Z!e!«e
2025-10-28 21:09:47 +01:00
«Z"Gd d
e«Z#Gdde«Z$e"jKd«d«Z&e"jOddge(e)¬«e d«e d«fdede
de*fd«Z+e"jOdeedg¬«de#fd«Z,e"jOdeedg¬«de$fd „«Z-e"j]ej^«e"j]ej^«e"j]ej^«e"j]ej^«e"j]ej^«e"j]ej^«e0d!k(rddl1Z1e1jdd"d#d$¬%«yy)&éN)ÚBaseÚ
db_dependencyÚengine)Ú load_dotenv)ÚFastAPIÚFileÚFormÚ
2025-10-28 21:09:47 +01:00
UploadFile)Ú BaseModel)Ú companiesÚfolk_crmÚ
insight_routeÚ investorsÚprojectsÚ report_route)Ú CompanyDataÚInvestmentResponseÚPaginatedResponse)ÚCompanyQueryProcessor)ÚInvestorProcessor)ÚQueryProcessorcóLtjjt¬«y)z.Initialize the database by creating all tables)ÚbindN)rÚmetadataÚ
2025-10-28 20:54:15 +01:00
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+r'r(r)ÚstrÚ__annotations__r+rrrr!r!#ó؃M÷
ò
rr!có,eZdZUeed<Gdd«Zy)ÚCompanyQueryRequestr"cóeZdZdddiiZy)úCompanyQueryRequest.Configr%r"zAFind me companies in the fintech sector located in San Francisco.Nr&rrrr+r31sà ØÐð
Ñrr+Nr,rrrr1r1.r/rr1ú/có
ddiS)HelloÚWorldrrrrÚhealthr89s
à  Ð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, Perplexity Gap Output (or Final Investor Profile)
- 100% manual JSON parsing - no LLM needed
- **Only extracts:** founded_year and key_executives
- **Only updates companies already in the database** (syncs with existing records)
2025-10-28 20:54:15 +01:00
- Skips companies not found in the database
2025-10-28 21:09:47 +01:00
**Benefits:**
- Fast processing (5-10s per record)
- Low cost (minimal or no LLM usage)
- Accurate data extraction
- Automatic database persistence
- Safe: won't create duplicate companies
Nzutf-8éT)Ú
save_to_db) ÚreadÚpdÚread_csvÚioÚStringIOÚdecoderÚparse_investorsÚparse_companies)r;r<r=ÚcontentÚdfÚ processorÚresultss rÚ parse_csvrM>s—èø€ð8—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)r:r9ÚrequestcƒólKt«}|j|j«ƒd{}|S7Œ­w)
Query investors using natural language.
2025-10-28 21:09:47 +01:00
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"
- "Find fintech investors in Silicon Valley"
- "Growth stage investors with $5M+ check sizes"
- "Healthcare investors in Europe"
N)rÚ
process_queryr"©rOrKrLs rÚquery_investorsrSls3èø€ô Ó €IØ×+¨G×,<Ñ,<Ó=×=€GØ €Nð>úó )4«2¬4z/query-companiescƒólKt«}|j|j«ƒd{}|S7Œ­w)a
2025-10-28 21:09:47 +01:00
Query companies using natural language.
Returns company matches with their investor relationships, team members, and sectors.
2025-10-28 21:09:47 +01:00
Supports queries like:
2025-10-28 20:54:15 +01:00
- "Show me fintech companies founded in 2020"
2025-10-28 21:09:47 +01:00
- "Find healthcare companies in San Francisco"
- "Companies in the AI sector"
2025-10-28 20:54:15 +01:00
- "Companies that received funding from Sequoia"