A Python script fetches data from a paginated API endpoint provided by BeyondChats. It identifies sources for each response and returns the citations as a JSON array. Additionally, there is an optional Flask app provided for a user-friendly interface to access the citations.
-
Clone the Repository:
git clone https://github.com/Saherpathan/Citation_project.git cd Citation_project
-
Install Dependencies:
pip install -r requirements.txt
To run the script and fetch citations from the API, execute the following command:
python main.py
The citations will be printed to the console.
-
Ensure Flask is installed:
pip install Flask
-
Run the Flask app:
python app.py
-
Access the endpoint: Open your browser and navigate to http://127.0.0.1:5000/citations to view the citations in a user-friendly interface.
main.py
: The main Python script for fetching data and processing citations.app.py
: Flask application script for providing a user interface.requirements.txt
: Contains a list of Python dependencies.README.md
: This file providing information about the project.
/citations
: Returns citations for all objects retrieved from the API.
SAHER PATHAN