fix ai estimation
This commit is contained in:
parent
91abde04a6
commit
29697f6274
1 changed files with 5 additions and 4 deletions
|
|
@ -1,5 +1,6 @@
|
|||
from datetime import date
|
||||
from enum import Enum
|
||||
import json
|
||||
from typing import Optional
|
||||
from src.cache.drug_cache import fetch_drug_with_dosage
|
||||
from src.models import PHQ, Applicant, Plan, EstimationResponse, EstimationDetails, EstimationResult
|
||||
|
|
@ -121,11 +122,11 @@ class EstimationService:
|
|||
"/chat/",
|
||||
json={"chat_session_id": session_id, "user_message": f"Check if this applicant eligible for insurance:\n {phq.model_dump_json()}"},
|
||||
)
|
||||
response_json = response.json()
|
||||
response_json = response.json()['message']
|
||||
print(f"AI DTQ Response: {response_json}")
|
||||
|
||||
dtq = not response_json["message"]["insurable"]
|
||||
reason = response_json["message"]["reason"]
|
||||
ai_response = json.loads(response_json)
|
||||
dtq = not ai_response["insurable"]
|
||||
reason = ai_response["reason"]
|
||||
return dtq, reason
|
||||
except Exception as e:
|
||||
print(f"Error in AI DTQ check: {e}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue