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

56 lines
7.1 KiB
Plaintext
Raw Normal View History

Ë
Û(iãóddlZddlZddlZddlmZmZmZddlm Z ddl
m Z m Z m
Z
mZmZddlmZddlmZddlmZmZmZmZmZmZddlmZmZmZdd lm Z dd
l!m"Z"dd l#m$Z$e «d Z%ejLe'«Z(e%«e «Z)e)jUed
gdd
gd
g¬«Gdde«Z+Gdde«Z,e)j[d«d«Z.e)j_ddge0e1¬«e d«e
d«fdedede2fd«Z3e)j_deedg¬ «d!e+fd"„«Z4e)j_d#eedg¬ «d!e,fd$„«Z5e)jmejn«e)jmejn«e)jmejn«e)jmejn«e)jmejn«e)jmejn«e'd%k(rddl8Z8e8jrd&d'd(¬)«yy)*éN)ÚBaseÚ
db_dependencyÚengine)Ú load_dotenv)ÚFastAPIÚFileÚFormÚ
HTTPExceptionÚ
UploadFile)ÚCORSMiddleware)Ú 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Ú
create_allr©óú?/home/oluwasanmi/Documents/Work/MKD/anton_wireframe/app/main.pyÚ
init_databaser!sä‡MM×Ѥ&ÐÕ)rÚ*T)Ú
allow_originsÚallow_credentialsÚ
allow_methodsÚ
allow_headerscó,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+3sà ØÐð
Ñrr2r.r/r0ÚstrÚ__annotations__r2rrr r(r(0ó؃M÷
ò
rr(có,eZdZUeed<Gdd«Zy)ÚCompanyQueryRequestr)cóeZdZdddiiZy)úCompanyQueryRequest.Configr,r)zAFind me companies in the fintech sector located in San Francisco.Nr-rrr r2r:>sà ØÐð
Ñrr2Nr3rrr r8r8;r6rr8ú/có
ddiS)HelloÚWorldrrrr Úhealthr?Fs
à  Ð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)
- Skips companies not found in the database
**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
2025-10-28 21:09:47 +01:00
Nzutf-8éT)Ú
2025-10-28 20:54:15 +01:00
save_to_db) ÚreadÚpdÚread_csvÚioÚStringIOÚdecoderÚparse_investorsÚparse_companies)rBrCrDÚcontentÚdfÚ processorÚresultss r Ú parse_csvrTKs—èø€ð8—I‘I“K×€GÜ ”R—[‘[ §¡°Ó!8Ó9Ó :€Bô#€Iàà!×1°"ÀÐF×Fˆàˆð"×1°"ÀÐàˆð øðGøð
2025-10-28 21:09:47 +01:00
Gús4B!B—A B!Á7BÁ8B!ÂBÂB!ÂB!ÂB!z/queryÚQuerying)rAr@Úrequestcƒó6K t«}|j|j«ƒd{}tj d|j
d«|S7Œ)#t $r5}tjd|d¬«tdt|«¬«d}~wwxYw­w) z,Query investors/funds using natural languageNz"Query completed successfully with ú resultszError in query_investors: T©Úexc_infoéô©Ú status_codeÚdetail)
rÚ