from flask import Flask, render_template, jsonify


class SayApp:
    def __init__(self):
        self.app = Flask(__name__, template_folder="templates", static_folder="static")
        self.add_routes()

    def add_routes(self):
        self.app.add_url_rule("/", "index", self.index)
        self.app.add_url_rule("/healthz", "healthz", self.health)
        self.app.add_url_rule("/api/profiles", "profiles", self.profiles)

    def index(self):
        return render_template("index.html")

    def healthz(self):
        return jsonify({"status": "ok"})

    def profiles(self):
        return jsonify([
            {"id": "ddm", "name": "DDM-120", "desc": "Быстрая модель"},
            {"id": "qwen", "name": "Qwen", "desc": "Мощная модель"},
            {"id": "deepseek", "name": "DeepSeek", "desc": "Глубокая аналитика"},
        ])

    def run(self):
        self.app.run(host="0.0.0.0", port=5000, debug=True)


if __name__ == "__main__":
    SayApp().run()

