This is a FastAPI application that accepts a file URL, fetches the file, partitions it, and sends the first chunk to an OpenAI GPT-4 model for processing.
- Clone this repository:
git clone https://github.com/yourusername/yourrepository.git
- Navigate to the project directory:
cd yourrepository
- Install Poetry if you haven't already:
curl -sSL https://install.python-poetry.org | python -
- Install the required Python packages:
poetry install
- Start the FastAPI server:
poetry run uvicorn main:app --reload
- Send a POST request to the
/process
endpoint with a JSON body that contains theurl
parameter. Replacehttp://example.com/path/to/your/file
with the actual URL of the file you want to process:curl -X POST "http://localhost:8000/process" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"url\":\"http://example.com/path/to/your/file\"}"
The application uses an OpenAI API key for the GPT-4 model. Make sure to replace the placeholder API key in the main.py
file with your actual OpenAI API key.
This project is licensed under the terms of the MIT license.