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

41 lines
4.5 KiB
Plaintext
Raw Normal View History

Ë
¿ãhc ãóŠddlZddlZddlmZmZmZddlmZddl m
Z
m Z m Z m
Z
ddlmZddlmZmZmZddlmZddlmZdd lmZe«d
Ze«e
«ZGd d e«Zej;d
«d«Zej?ddge e!¬«e d«e d«fdede
de"fd«Z#ej?dedg¬«defd«Z$ejKejL«ejKejL«ejKejL«e'dk(rddl(Z(e(jRdddd ¬!«yy)"éN)ÚBaseÚ
db_dependencyÚengine)Ú load_dotenv)ÚFastAPIÚFileÚFormÚ
UploadFile)Ú BaseModel)Ú companiesÚ investorsÚprojects)Ú InvestorList)Ú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ÚConfigrsà ØÐð
Ñ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ƒó¤K|j«ƒd{}tjtj|j d«««}t
«}|dk(r|j|d¬«ƒd{}|S|j|d¬«ƒd{}|Dcgc] }t|d«r|j«n|Œ"c}S7Œ®7ŒO7Œ4cc}w­w)
Parse and import CSV data into the database.
For investors: Expected columns - Name, Website, Final Investor Profile, Final Profile sourcing
For companies: Uses legacy LLM-based parsing
The new investor parser:
- Manually parses JSON profiles for efficiency
- Uses LLM only for currency conversion to USD
- Handles AUM, fund sizes, and check sizes as integers
- Automatically saves to database
Nzutf-8éT)Ú
save_to_dbÚ
model_dump) ÚreadÚpdÚread_csvÚioÚStringIOÚdecoderÚparse_investorsÚparse_companiesÚhasattrr4)r.r/r0ÚcontentÚdfÚ processorÚresultsÚrs rÚ parse_csvrC+èø€ð"—I‘I“K×€GÜ ”R—[‘[ §¡°Ó!8Ó9Ó :€Bô#€Iàà!×1°"ÀÐF×Fˆàˆð"×1°"ÀÐF×FˆàKRÖSÀa¤'¨!¨\Ô": ÀÑ øðGøð
GúâSùsFCC—A CÁ7CÁ8CÂC ÂCÂ%C ÃCÃCÃ CÃ Cz/queryÚQuerying)r-r,ÚrequestcƒóXKt«}|j|j«}|S­w)zÿ
Query investors using natural language.
Supports queries like:
- "Show me seed stage investors"