File size: 528 Bytes
2d521fd
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from fastapi import APIRouter, HTTPException
from app.models.intent_models import IntentSimulation, IntentSimulationResponse
from app.services.intent_service import simulate_intent

router = APIRouter()


@router.post("/simulate_intent", response_model=IntentSimulationResponse)
async def simulate_intent_endpoint(intent: IntentSimulation):
    try:
        result = simulate_intent(intent)
        return IntentSimulationResponse(**result)
    except Exception as e:
        raise HTTPException(status_code=500, detail=str(e))