diff --git a/README.md b/README.md index 6b3da67..826a547 100644 --- a/README.md +++ b/README.md @@ -211,3 +211,28 @@ This script is released under the MIT License. - Anthropic for providing the AI models and API. - Rich for the beautiful console formatting. + +## Flask App Integration + +We have now integrated a Flask app to provide a user-friendly interface for interacting with the Maestro framework. This addition allows users to input objectives and view results through a web interface, enhancing the overall usability of the tool. + +### Setting Up and Running the Flask App + +To set up and run the Flask app, follow these steps: + +1. Ensure Flask is installed by running `pip install Flask` or by adding Flask to the `requirements.txt` file and running `pip install -r requirements.txt`. +2. Navigate to the directory containing the Flask app files (`app.py`, `templates/`, and `static/`). +3. Run the Flask app by executing `python app.py` in your terminal or command prompt. +4. Access the web interface by opening a web browser and navigating to `http://localhost:5000/`. + +The Flask app supports all features of the Maestro framework, allowing users to input objectives and view the orchestrated task breakdown and execution results in a structured and easy-to-read format. + +### UI Features + +The Flask app includes the following UI features: + +- A form for inputting objectives. +- A results display area where the orchestrated task breakdown and execution results are shown. +- Basic styling for improved readability and user experience. + +This integration aims to make the Maestro framework more accessible and user-friendly, providing an intuitive way for users to leverage the power of AI-assisted task breakdown and execution. diff --git a/app.py b/app.py new file mode 100644 index 0000000..5b142d8 --- /dev/null +++ b/app.py @@ -0,0 +1,21 @@ +from flask import Flask, render_template, request, redirect, url_for +import os +import maestro_anyapi + +app = Flask(__name__) + +@app.route('/', methods=['GET', 'POST']) +def index(): + if request.method == 'POST': + objective = request.form.get('objective') + if objective: + results = maestro_anyapi.run_maestro(objective) + return render_template('results.html', objective=objective, results=results) + return render_template('index.html') + +@app.route('/results') +def results(): + return "This page will display the results." + +if __name__ == '__main__': + app.run(debug=True) diff --git a/requirements.txt b/requirements.txt index dff8651..2ead9a7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,3 +4,4 @@ tavily-python ollama groq openai +Flask diff --git a/static/css/style.css b/static/css/style.css new file mode 100644 index 0000000..cb19d5f --- /dev/null +++ b/static/css/style.css @@ -0,0 +1,64 @@ +/* Basic styling for the Flask app UI */ +body { + font-family: Arial, sans-serif; + margin: 0; + padding: 0; + background-color: #f4f4f4; +} + +.container { + width: 80%; + margin: auto; + overflow: hidden; +} + +header { + background: #50a3a2; + color: #ffffff; + padding-top: 30px; + min-height: 70px; + border-bottom: #076585 3px solid; +} + +header h1 { + text-align: center; + margin: 0; + padding-bottom: 10px; +} + +nav { + background: #444; + color: #ffffff; + text-align: center; + padding: 5px; +} + +nav ul { + margin: 0; + padding: 0; +} + +nav ul li { + display: inline; + margin-right: 10px; +} + +nav ul li a { + color: white; + text-decoration: none; +} + +main { + padding: 20px; +} + +footer { + background: #444; + color: white; + text-align: center; + padding: 10px; + position: fixed; + left: 0; + bottom: 0; + width: 100%; +} diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..d2c4b0e --- /dev/null +++ b/templates/base.html @@ -0,0 +1,29 @@ + + +
+ + +{{ results }}
+