Spaces:
Paused
Paused
Update app/routes/llm_extraction.py
Browse files13 unmodified lines141516171819205 unmodified lines262728293031323334353613 unmodified linesclass ExtractRequest(BaseModel):cleaned_text: strfile_id: Optional[str] = None5 unmodified lines@router.post("/medical-data")async def extract_medical_data(request: ExtractRequest, db: Session = Depends(get_db)):"""Extract structured medical data from cleaned text using LLM (Legacy Endpoint)"""try:extractor = LLMExtractor()# --- Blocking: Groq HTTP call ---result = await asyncio.to_thread(extractor.extract_from_text, request.cleaned_text)return resultexcept Exception as e:raise HTTPException(status_code=500, detail=str(e))13 unmodified lines14151617181920215 unmodified lines27282930313233343536373813 unmodified linesclass ExtractRequest(BaseModel):cleaned_text: Optional[str] = Noneraw_text: Optional[str] = Nonefile_id: Optional[str] = None5 unmodified lines@router.post("/medical-data")async def extract_medical_data(request: ExtractRequest, db: Session = Depends(get_db)):"""Extract structured medical data from cleaned text using LLM"""try:extractor = LLMExtractor()text_to_process = request.cleaned_text or request.raw_text or ""# --- Blocking: Groq HTTP call ---result = await asyncio.to_thread(extractor.extract_from_text, text_to_process)return resultexcept Exception as e:raise HTTPException(status_code=500, detail=str(e))
app/routes/llm_extraction.py+5-3