From f1fb9ac925cef60aa23a798ee7f681128e33c696 Mon Sep 17 00:00:00 2001 From: abhishekbhakat Date: Mon, 24 Feb 2025 10:15:48 +0000 Subject: [PATCH] Spliting out from local install --- plugins/airflow-wingman/__init__.py | 0 plugins/airflow-wingman/plugin.py | 85 -------- plugins/airflow-wingman/pyproject.toml | 20 -- .../templates/wingman_chat.html | 193 ------------------ 4 files changed, 298 deletions(-) delete mode 100644 plugins/airflow-wingman/__init__.py delete mode 100644 plugins/airflow-wingman/plugin.py delete mode 100644 plugins/airflow-wingman/pyproject.toml delete mode 100644 plugins/airflow-wingman/templates/wingman_chat.html diff --git a/plugins/airflow-wingman/__init__.py b/plugins/airflow-wingman/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/plugins/airflow-wingman/plugin.py b/plugins/airflow-wingman/plugin.py deleted file mode 100644 index 9b5f6cb..0000000 --- a/plugins/airflow-wingman/plugin.py +++ /dev/null @@ -1,85 +0,0 @@ -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" - - AVAILABLE_MODELS = { - "anthropic": { - "name": "Anthropic", - "endpoint": "https://api.anthropic.com/v1/messages", - "models": [ - { - "id": "claude-3.5-sonnet", - "name": "Claude 3.5 Sonnet", - "default": True, - "context_window": 200000, - "description": "Input $3/M tokens, Output $15/M tokens", - }, - { - "id": "claude-3.5-haiku", - "name": "Claude 3.5 Haiku", - "default": False, - "context_window": 200000, - "description": "Input $0.80/M tokens, Output $4/M tokens", - }, - ], - }, - "openrouter": { - "name": "OpenRouter", - "endpoint": "https://openrouter.ai/api/v1/chat/completions", - "models": [ - { - "id": "anthropic/claude-3.5-sonnet", - "name": "Claude 3.5 Sonnet", - "default": False, - "context_window": 200000, - "description": "Input $3/M tokens, Output $15/M tokens", - }, - { - "id": "anthropic/claude-3.5-haiku", - "name": "Claude 3.5 Haiku", - "default": False, - "context_window": 200000, - "description": "Input $0.80/M tokens, Output $4/M tokens", - }, - ], - }, - } - - @expose("/") - def chat(self): - """ - Chat interface for Airflow Wingman. - """ - return self.render_template( - "wingman_chat.html", title="Airflow Wingman", models=self.AVAILABLE_MODELS - ) - - -# Create AppBuilder View -v_appbuilder_view = WingmanView() -v_appbuilder_package = { - "name": "Wingman", - "category": "AI", - "view": v_appbuilder_view, -} - - -# Create Plugin -class WingmanPlugin(AirflowPlugin): - name = "wingman" - flask_blueprints = [bp] - appbuilder_views = [v_appbuilder_package] diff --git a/plugins/airflow-wingman/pyproject.toml b/plugins/airflow-wingman/pyproject.toml deleted file mode 100644 index b98e4e3..0000000 --- a/plugins/airflow-wingman/pyproject.toml +++ /dev/null @@ -1,20 +0,0 @@ -[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"] diff --git a/plugins/airflow-wingman/templates/wingman_chat.html b/plugins/airflow-wingman/templates/wingman_chat.html deleted file mode 100644 index dafa921..0000000 --- a/plugins/airflow-wingman/templates/wingman_chat.html +++ /dev/null @@ -1,193 +0,0 @@ -{% extends "appbuilder/base.html" %} - -{% block content %} -
- -
-
-
-
-

Airflow Wingman

-
-
-
-
- -
- -
-
-
-

Model Selection

-
-
- {% for provider_id, provider in models.items() %} -
-

{{ provider.name }}

- {% for model in provider.models %} -
- -
- {% endfor %} -
- {% endfor %} -
- - -
- - -
-
-

API Key

-
-
-
- - - Your API key will be used for the selected provider - -
-
-
-
- - -
-
-
- -
- -
-
-
-
- - - - -{% endblock %}