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

71 lines
6.5 KiB
Plaintext
Raw Normal View History

Ë
2025-10-28 20:54:15 +01:00
Zi{ãó¸ddlZddlZddlZddlZddlmZmZmZddl m
Z
ddl m Z m
Z
2025-10-28 20:54:15 +01:00
mZmZddlmZddlmZmZmZmZmZmZddlmZmZmZddlmZdd lm Z dd
l!m"Z"e
«d Z#e#«e «Z$Gd d
e«Z%Gdde«Z&e$jOd«d«Z(e$jSddge*e+¬«e
d«ed«fdedede,fd«Z-e$jSdeedg¬«de%fd«Z.e$jSdeedg¬«de&fd „«Z/e$jaejb«e$jaejb«e$jaejb«e$jaejb«e$jaejb«e$jaejb«e2d!k(rddl3Z3e3jhd"d#d$¬%«yy)&éN)ÚBaseÚ
db_dependencyÚengine)Ú load_dotenv)ÚFastAPIÚFileÚFormÚ
2025-10-28 20:54:15 +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Ú
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+r32sà ØÐð
Ñ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
**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ƒóXKt«}|j|j«}|S­w)
Query investors using natural language.
2025-10-28 20:54:15 +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"
)rÚ
process_queryr"©rOrKrLs rÚquery_investorsrSls+èø€ô Ó €IØ×% g×&6Ñ&6Ó7€GØ €Nùó(*z/query-companiescƒóXKt«}|j|j«}|S­w)a
2025-10-28 20:54:15 +01:00
Query companies using natural language.
Returns company matches with their investor relationships, team members, and sectors.
2025-10-28 20:54:15 +01:00
Supports queries like:
- "Show me fintech companies founded in 2020"
- "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"