A proof of concept on how we can leverage LLM to automate data entry faster.
|
|
1 hafta önce | |
|---|---|---|
| sample_medical_receipts | 1 hafta önce | |
| services | 1 hafta önce | |
| .gitignore | 1 hafta önce | |
| README.md | 1 hafta önce | |
| main.py | 1 hafta önce | |
| requirements.txt | 1 hafta önce | |
| schemas.py | 1 hafta önce |
This project provides a FastAPI-based backend for extracting structured data from medical receipts using OpenAI's GPT-4o model with structured outputs.
beta.chat.completions.parse to ensure extracted data adheres to a Pydantic schema.Install Dependencies:
pip install -r requirements.txt
.env file in the root directory and add your OpenAI API key:
env
OPENAI_API_KEY=your_api_key_here
Run the Server:
python main.py
Or using uvicorn:
uvicorn main:app --reload
GET /healthReturns the status of the server.
POST /api/v1/extractExtracts data from a medical receipt image.
Request Body:
file: Multipart image file.user_name (optional): Name of the employee.department (optional): Department of the employee.Response:
Returns a structured JSON matching the ExtractionResponse schema.
main.py: Entry point and API endpoints.schemas.py: Pydantic models for data validation and structured output.services/:
openai_service.py: Logic for interacting with OpenAI API.requirements.txt: Python dependencies..env: Environment variables (not tracked by git).