feat: Update query endpoint to return paginated investment responses with fund details

This commit is contained in:
bolade
2025-10-08 14:19:36 +01:00
parent 58722f1102
commit cefe89bb67
8 changed files with 107 additions and 45 deletions
+7 -2
View File
@@ -6,7 +6,7 @@ from dotenv import load_dotenv
from fastapi import FastAPI, File, Form, UploadFile
from pydantic import BaseModel
from routers import companies, investors, projects
from schemas.router_schemas import InvestorList
from schemas.router_schemas import InvestmentResponse, PaginatedResponse
from services.llm_parser import InvestorProcessor
from services.querying import QueryProcessor
@@ -84,11 +84,16 @@ async def parse_csv(
return results
@app.post("/query", response_model=InvestorList, tags=["Querying"])
@app.post(
"/query", response_model=PaginatedResponse[InvestmentResponse], tags=["Querying"]
)
async def query_investors(request: QueryRequest):
"""
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"
- "Find fintech investors in Silicon Valley"