-
Notifications
You must be signed in to change notification settings - Fork 648
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from Doriandarko/flask-integration
Integrate Flask app with maestro-anyapi.py
- Loading branch information
Showing
6 changed files
with
169 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ tavily-python | |
ollama | ||
groq | ||
openai | ||
Flask |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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%; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Maestro Task Orchestrator</title> | ||
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}"> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<header> | ||
<h1>Maestro Task Orchestrator</h1> | ||
</header> | ||
<nav> | ||
<ul> | ||
<li><a href="/">Home</a></li> | ||
<li><a href="/about">About</a></li> | ||
</ul> | ||
</nav> | ||
<main> | ||
{% block content %} | ||
{% endblock %} | ||
</main> | ||
<footer> | ||
<p>© 2023 Maestro Task Orchestrator</p> | ||
</footer> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Maestro Task Orchestrator</title> | ||
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}"> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<header> | ||
<h1>Maestro Task Orchestrator</h1> | ||
</header> | ||
<main> | ||
<form action="/" method="post"> | ||
<label for="objective">Enter your objective:</label> | ||
<textarea id="objective" name="objective" rows="4" required></textarea> | ||
<button type="submit">Submit</button> | ||
</form> | ||
{% if results %} | ||
<section id="results"> | ||
<h2>Results</h2> | ||
<p>{{ results }}</p> | ||
</section> | ||
{% endif %} | ||
</main> | ||
</div> | ||
</body> | ||
</html> |