from fastapi import APIRouter from app.models.prediction_models import PredictionRequest, PredictionResponse from typing import List from app.agents.real_state_agent import real_state_agent import os import openai openai.api_key = os.getenv("OPENAI_API_KEY") router = APIRouter() ## MODIFICAR ESTO: @router.post("/", response_model=List[PredictionResponse]) def predict(request: PredictionRequest): response = real_state_agent.run(request.question) # ver el type esto sigue siendo list, pero ahora dije que queiro una response string: response_data = [{"response": response}] return response_data