This professional-grade Flask application provides RESTful endpoints to interact with arXiv papers, generate embeddings using OpenAI's API, and store these embeddings in AWS DynamoDB. It is designed for ease of use, extensibility, and to serve as a foundational example for further development.
- Prerequisites
- Installation
- Configuration
- Running the Application
- API Endpoints
- ArxivAPI Class
- Notes
- Contributing
- License
- Python 3.7+
- Flask
- boto3
- openai
- requests
- python-dotenv
-
Clone the repository:
git clone <repository-url> cd <repository-directory>
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the dependencies:
pip install -r requirements.txt
-
Create a
.env
file in the root directory of the project and add the following environment variables:OPENAI_API_KEY=your_openai_api_key AWS_ACCESS_KEY_ID=your_aws_access_key_id AWS_SECRET_ACCESS_KEY=your_aws_secret_access_key
-
Ensure that the
TABLE_NAME
variable in theapp.py
file is set to the name of your DynamoDB table:TABLE_NAME = 'EmbeddingsTable' # Change to your DynamoDB table name
To run the Flask application, use the following command:
python index.py