Multi-Rag / api /MultiRag /routes /analyse_url.py
VashuTheGreat2's picture
Upload folder using huggingface_hub
5551822 verified
import fastapi
import logging
router = fastapi.APIRouter()
@router.post("/analyse_url")
async def analyse_url(thread_id:str,url: str):
try:
if not url:
return {"data": "URL missing in headers"}
res = await run_agent(thread_id, url)
return {"data": res}
except Exception as e:
logging.error(f"Chat endpoint error: {e}")
return {"data": "Failed to chat"}