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

50 lines
4.6 KiB
Plaintext
Raw Normal View History

Ë
óîäh› ãóŠ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ƒó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)r.r/r0ÚcontentÚdfÚ processorÚresultss rÚ parse_csvr@+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)zÿ
Query investors using natural language.
Supports queries like:
- "Show me seed stage investors"