Plugin skeleton
This commit is contained in:
0
plugins/airflow-wingman/__init__.py
Normal file
0
plugins/airflow-wingman/__init__.py
Normal file
43
plugins/airflow-wingman/plugin.py
Normal file
43
plugins/airflow-wingman/plugin.py
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
from airflow.plugins_manager import AirflowPlugin
|
||||||
|
from flask_appbuilder import BaseView as AppBuilderBaseView, expose
|
||||||
|
from flask import Blueprint
|
||||||
|
|
||||||
|
|
||||||
|
bp = Blueprint(
|
||||||
|
"wingman",
|
||||||
|
__name__,
|
||||||
|
template_folder="templates",
|
||||||
|
static_folder="static",
|
||||||
|
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"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# Create AppBuilder View
|
||||||
|
v_appbuilder_view = WingmanView()
|
||||||
|
v_appbuilder_package = {
|
||||||
|
"name": "Airflow Wingman",
|
||||||
|
"category": "AI",
|
||||||
|
"view": v_appbuilder_view,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Create Plugin
|
||||||
|
class WingmanPlugin(AirflowPlugin):
|
||||||
|
name = "wingman"
|
||||||
|
flask_blueprints = [bp]
|
||||||
|
appbuilder_views = [v_appbuilder_package]
|
||||||
20
plugins/airflow-wingman/pyproject.toml
Normal file
20
plugins/airflow-wingman/pyproject.toml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
[build-system]
|
||||||
|
requires = ["setuptools", "wheel"]
|
||||||
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
|
[project]
|
||||||
|
name = "airflow-wingman"
|
||||||
|
version = "0.1.0"
|
||||||
|
description = "Airflow plugin to enable LLMs chat"
|
||||||
|
authors = [
|
||||||
|
{name = "Abhishek Bhakat", email = "abhishek.bhakat@hotmail.com"}
|
||||||
|
]
|
||||||
|
dependencies = [
|
||||||
|
"apache-airflow>=2.10.0",
|
||||||
|
]
|
||||||
|
|
||||||
|
[project.urls]
|
||||||
|
repository = "https://github.com/abhishekbhakat/airflow-mcp-server"
|
||||||
|
|
||||||
|
[tool.setuptools]
|
||||||
|
packages = ["airflow-wingman"]
|
||||||
5
plugins/airflow-wingman/templates/wingman_chat.html
Normal file
5
plugins/airflow-wingman/templates/wingman_chat.html
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{% extends "appbuilder/base.html" %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user