debug estimation request
This commit is contained in:
parent
25f091d02c
commit
f873b7e710
2 changed files with 7 additions and 3 deletions
|
|
@ -78,12 +78,16 @@ async def init_chat(request: models.InitializeChatRequest):
|
||||||
async def estimate(request: models.EstimationRequest):
|
async def estimate(request: models.EstimationRequest):
|
||||||
"""Handle insurance estimation requests"""
|
"""Handle insurance estimation requests"""
|
||||||
try:
|
try:
|
||||||
if not request.applicants or not request.plans:
|
if not request.applicants:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=400,
|
status_code=400,
|
||||||
detail="Missing required applicants or plans"
|
detail="Missing required applicants or plans"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
print("estimation request: ", request)
|
||||||
|
if not request.plans:
|
||||||
|
request.plans = list()
|
||||||
|
|
||||||
estimation_service = EstimationService()
|
estimation_service = EstimationService()
|
||||||
estimation_response = await estimation_service.estimate_insurance(request.applicants, request.phq, request.plans, request.coverage)
|
estimation_response = await estimation_service.estimate_insurance(request.applicants, request.phq, request.plans, request.coverage)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ class EstimationRequest(BaseModel):
|
||||||
userId: str | int | None = Field(None, description="Unique identifier")
|
userId: str | int | None = Field(None, description="Unique identifier")
|
||||||
coverage: int = 1
|
coverage: int = 1
|
||||||
applicants: List[Applicant]
|
applicants: List[Applicant]
|
||||||
plans: List[Plan]
|
plans: List[Plan] | None = None
|
||||||
phq: PHQ
|
phq: PHQ
|
||||||
income: float
|
income: float
|
||||||
address: Address
|
address: Address
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue