add webpage info
This commit is contained in:
parent
e4d2e64ce7
commit
959fd1ac86
5 changed files with 83 additions and 8 deletions
|
|
@ -3,6 +3,7 @@ from fastapi import APIRouter, HTTPException
|
|||
from src.services.estimation_service_v2 import EstimationService
|
||||
|
||||
from . import models
|
||||
from ...cache.page_cache import get_page_description
|
||||
from ...services.chat_service import chat_service
|
||||
|
||||
router = APIRouter()
|
||||
|
|
@ -11,10 +12,15 @@ router = APIRouter()
|
|||
async def insurance_chat(request: models.InsuranceChatRequest):
|
||||
"""Handle insurance chat requests"""
|
||||
try:
|
||||
current_page = None
|
||||
if request.context and request.context.page:
|
||||
page_id = request.context.page
|
||||
current_page = await get_page_description(page_id)
|
||||
result = await chat_service.process_insurance_chat(
|
||||
message=request.message,
|
||||
session_id=request.session_id,
|
||||
uid=str(request.userId),
|
||||
current_page=current_page,
|
||||
)
|
||||
|
||||
return models.InsuranceChatResponse(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue