Files
2025-03-25 23:02:22 +01:00

22 lines
729 B
Python

from flask import Flask, render_template
import inbox
from assistant import process
app = Flask(__name__)
@app.route("/emails")
def emails():
return inbox.fetch_emails()
@app.route("/")
def index():
instructions = """
You are a helpfull assistant. Your job is to go to all the emails and provide a short summary of all emails
in the inbox. Then go through all emails and suggest what is most important to do next and explain your
decision. Write your answer in German.
"""
answer = process(instructions=instructions)
return render_template("index.html", answer=answer,messages=inbox.fetch_emails())
if __name__ == "__main__":
app.run(debug=True, host="0.0.0.0", port=5003)