NoteMaster AI's FastAPI component provides a robust backend service for transforming photos into structured notes using AI. It handles image processing, text extraction, and note generation, offering a RESTful API for seamless integration into various applications.
- Image Upload: Accepts multiple image formats for processing.
- Text Extraction: Utilizes Tesseract OCR for extracting text from images.
- AI-Driven Note Generation: Uses AI models to convert extracted text into organized notes.
- API Endpoints: Provides endpoints for image processing, note management, and more.
The FastAPI component supports the following AI models:
- GPT-3.5 Turbo
- GPT-4o
- Llama 3
- Mixtral 70b
- BlackBox
- Meta AI
If you want to use the app without FastAPI, you can use the first release of NoteMaster AI which is Streamlit-only:
- Go to the Releases page.
- Download the first release.
- Follow the installation steps as mentioned on the release page.
The current version includes FastAPI for enhanced functionality. Follow the standard installation steps mentioned below to use this version.
-
Clone the repository:
git clone https://github.com/codewithdark-git/NoteMaster-AI.git cd NoteMaster-AI
-
Install the required packages:
pip install -r requirements.txt
-
Run the API generation script:
python backend/generate_api.py
After running the script, copy the API from
.env
and add it to your frontend configuration. -
Start the FastAPI server:
uvicorn fastapi_app:app --reload
-
Access the API:
- The API runs on
http://localhost:8000
- Access the interactive API documentation at
http://localhost:8000/docs
- The API runs on
-
Endpoints:
POST /generate_from_images
: Generate notes from uploaded imagesPOST /generate_from_link
: Generate notes from a linkGET /notes/
: Retrieve all notesDELETE /notes/{note_id}
: Remove notesPOST /follow-up-question/
: Generate a follow-up response based on a saved note
-
Example Usage:
curl -X POST -F "files=@image1.jpg" http://localhost:8000/generate_from_images
curl -X POST -F http://localhost:8000/generate_from_link
curl -X GET http://localhost:8000/notes/
curl -X DELETE http://localhost:8000/notes/{note_id}
curl -X POST -F "note_id=1" -F "user_prompt=What more can I learn?" http://localhost:8000/follow-up-question/
- Model Configuration: Adjust model settings in
fastapi_app.py
. - API Behavior: Modify processing parameters and response formats.
Contributions are welcome! Please submit a pull request or open an issue to discuss your ideas.
This project is licensed under the MIT License.