add base64 decode for context.application
This commit is contained in:
parent
b2eba19fb1
commit
d8d38ab132
2 changed files with 6 additions and 0 deletions
|
|
@ -1,3 +1,6 @@
|
||||||
|
import base64
|
||||||
|
import json
|
||||||
|
|
||||||
from fastapi import APIRouter, HTTPException
|
from fastapi import APIRouter, HTTPException
|
||||||
|
|
||||||
from src.services.estimation_service_v2 import EstimationService
|
from src.services.estimation_service_v2 import EstimationService
|
||||||
|
|
@ -20,6 +23,8 @@ async def insurance_chat(request: models.InsuranceChatRequest):
|
||||||
application = None
|
application = None
|
||||||
if request.context and request.context.application:
|
if request.context and request.context.application:
|
||||||
application = request.context.application
|
application = request.context.application
|
||||||
|
elif request.context and request.context.applicationDTO:
|
||||||
|
application = json.loads(base64.b64decode(request.context.applicationDTO).decode())
|
||||||
|
|
||||||
result = await chat_service.process_insurance_chat(
|
result = await chat_service.process_insurance_chat(
|
||||||
message=request.message,
|
message=request.message,
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,7 @@ class EstimationResponse(BaseModel):
|
||||||
class InsuranceChatContext(BaseModel):
|
class InsuranceChatContext(BaseModel):
|
||||||
page: str
|
page: str
|
||||||
application: dict | None = None
|
application: dict | None = None
|
||||||
|
applicationDTO: str | None = None
|
||||||
|
|
||||||
class InsuranceChatRequest(BaseModel):
|
class InsuranceChatRequest(BaseModel):
|
||||||
userId: str | int | None = None
|
userId: str | int | None = None
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue