restructure code for modularity and use ai modules

This commit is contained in:
2025-02-24 13:11:09 +00:00
parent f3cc238130
commit eea23b2097
5 changed files with 304 additions and 47 deletions

View File

@@ -1,10 +1,11 @@
"""Plugin definition for Airflow Wingman."""
from airflow.plugins_manager import AirflowPlugin
from flask_appbuilder import BaseView as AppBuilderBaseView, expose
from flask import Blueprint
from airflow_wingman.llms_models import MODELS
from airflow_wingman.views import WingmanView
# Create Blueprint
bp = Blueprint(
"wingman",
__name__,
@@ -13,21 +14,6 @@ bp = Blueprint(
static_url_path="/static/wingman",
)
class WingmanView(AppBuilderBaseView):
route_base = "/wingman"
default_view = "chat"
@expose("/")
def chat(self):
"""
Chat interface for Airflow Wingman.
"""
return self.render_template(
"wingman_chat.html", title="Airflow Wingman", models=MODELS
)
# Create AppBuilder View
v_appbuilder_view = WingmanView()
v_appbuilder_package = {
@@ -39,6 +25,8 @@ v_appbuilder_package = {
# Create Plugin
class WingmanPlugin(AirflowPlugin):
"""Airflow plugin for Wingman chat interface."""
name = "wingman"
flask_blueprints = [bp]
appbuilder_views = [v_appbuilder_package]