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

54 lines
4.9 KiB
Plaintext
Raw Normal View History

Ë
’ªæhŽ
ãóÎddlZddlZddlmZmZmZddlmZddl m
Z
m Z m Z m
Z
ddlmZddlmZmZmZmZddlmZmZddlmZdd lmZe«d
Ze«e
«ZGd d e«Zej?d
«d«Z ejCddge"e#¬«e d«e d«fdede
de$fd«Z%ejCdeedg¬«defd«Z&ejOejP«ejOejP«ejOejP«ejOejP«e)dk(rddl*Z*e*jVdddd ¬!«yy)"éN)ÚBaseÚ
db_dependencyÚengine)Ú load_dotenv)ÚFastAPIÚFileÚFormÚ
UploadFile)Ú BaseModel)Ú companiesÚfolk_crmÚ investorsÚprojects)Ú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ÚexamplerzDFind 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&rrrrrs؃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)r0r1r2ÚcontentÚdfÚ processorÚresultss rÚ parse_csvrB+s—èø€ð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)r/r.Ú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"