airflow-chat 0.1.0a2__tar.gz → 0.1.0a4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. {airflow_chat-0.1.0a2 → airflow_chat-0.1.0a4}/PKG-INFO +1 -1
  2. {airflow_chat-0.1.0a2 → airflow_chat-0.1.0a4}/airflow_chat/plugins/airflow_chat.py +9 -7
  3. {airflow_chat-0.1.0a2 → airflow_chat-0.1.0a4}/airflow_chat/plugins/app/databases/postgres.py +1 -1
  4. {airflow_chat-0.1.0a2 → airflow_chat-0.1.0a4}/airflow_chat/plugins/app/models/__init__.py +3 -3
  5. {airflow_chat-0.1.0a2 → airflow_chat-0.1.0a4}/airflow_chat/plugins/app/server/chat.py +1 -1
  6. {airflow_chat-0.1.0a2 → airflow_chat-0.1.0a4}/airflow_chat/plugins/app/server/llm.py +3 -3
  7. {airflow_chat-0.1.0a2 → airflow_chat-0.1.0a4}/airflow_chat/plugins/app/server/main.py +4 -4
  8. {airflow_chat-0.1.0a2 → airflow_chat-0.1.0a4}/airflow_chat/plugins/app/utils/config.py +1 -1
  9. {airflow_chat-0.1.0a2 → airflow_chat-0.1.0a4}/airflow_chat/plugins/app/utils/logger.py +1 -1
  10. {airflow_chat-0.1.0a2 → airflow_chat-0.1.0a4}/pyproject.toml +1 -1
  11. {airflow_chat-0.1.0a2 → airflow_chat-0.1.0a4}/LICENSE +0 -0
  12. {airflow_chat-0.1.0a2 → airflow_chat-0.1.0a4}/airflow_chat/__init__.py +0 -0
  13. {airflow_chat-0.1.0a2 → airflow_chat-0.1.0a4}/airflow_chat/plugins/README.md +0 -0
  14. {airflow_chat-0.1.0a2 → airflow_chat-0.1.0a4}/airflow_chat/plugins/__init__.py +0 -0
  15. {airflow_chat-0.1.0a2 → airflow_chat-0.1.0a4}/airflow_chat/plugins/app/__init__.py +0 -0
  16. {airflow_chat-0.1.0a2 → airflow_chat-0.1.0a4}/airflow_chat/plugins/app/databases/__init__.py +0 -0
  17. {airflow_chat-0.1.0a2 → airflow_chat-0.1.0a4}/airflow_chat/plugins/app/models/inference/__init__.py +0 -0
  18. {airflow_chat-0.1.0a2 → airflow_chat-0.1.0a4}/airflow_chat/plugins/app/models/inference/antropic_model.py +0 -0
  19. {airflow_chat-0.1.0a2 → airflow_chat-0.1.0a4}/airflow_chat/plugins/app/models/inference/bedrock_model.py +0 -0
  20. {airflow_chat-0.1.0a2 → airflow_chat-0.1.0a4}/airflow_chat/plugins/app/models/inference/openai_model.py +0 -0
  21. {airflow_chat-0.1.0a2 → airflow_chat-0.1.0a4}/airflow_chat/plugins/app/server/__init__.py +0 -0
  22. {airflow_chat-0.1.0a2 → airflow_chat-0.1.0a4}/airflow_chat/plugins/app/utils/__init__.py +0 -0
  23. {airflow_chat-0.1.0a2 → airflow_chat-0.1.0a4}/airflow_chat/plugins/app/utils/singleton.py +0 -0
  24. {airflow_chat-0.1.0a2 → airflow_chat-0.1.0a4}/airflow_chat/plugins/templates/chat_interface.html +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: airflow-chat
3
- Version: 0.1.0a2
3
+ Version: 0.1.0a4
4
4
  Summary: An Apache Airflow plugin that enables AI-powered chat interactions with your Airflow instance through MCP integration and an intuitive UI.
5
5
  License: MIT
6
6
  Author: Hipposys
@@ -251,10 +251,10 @@ class LLMChatAgent:
251
251
 
252
252
  except requests.RequestException as e:
253
253
  print(f"Failed to initialize chat session: {e}")
254
- return False, None
254
+ return False, e
255
255
  except Exception as e:
256
256
  print(f"Unexpected error initializing session: {e}")
257
- return False, None
257
+ return False, e
258
258
 
259
259
  def stream_chat_response(self, message, conversation_id=None):
260
260
  """Stream response from FastAPI backend"""
@@ -372,8 +372,9 @@ class AirflowChatView(AppBuilderBaseView):
372
372
  # Return streaming response
373
373
  def generate():
374
374
  try:
375
- if os.environ.get('INTERNAL_AI_ASSISTANT_SERVER', True):
376
- from app.server.llm import get_stream_agent_responce
375
+ if str(os.environ.get('INTERNAL_AI_ASSISTANT_SERVER', True))\
376
+ .lower() == 'true':
377
+ from .app.server.llm import get_stream_agent_responce
377
378
  md_uri = str(settings.Session().bind.url).replace('postgresql+psycopg2', 'postgres')
378
379
  loop = asyncio.new_event_loop()
379
380
  asyncio.set_event_loop(loop)
@@ -443,10 +444,11 @@ class AirflowChatView(AppBuilderBaseView):
443
444
  conversation_id = str(uuid.uuid4())
444
445
 
445
446
  try:
446
- if not os.environ.get('INTERNAL_AI_ASSISTANT_SERVER', True):
447
+ if not str(os.environ.get('INTERNAL_AI_ASSISTANT_SERVER', True))\
448
+ .lower() == 'true':
447
449
  success, cookies = self.llm_agent.initialize_chat_session(conversation_id)
448
450
  else:
449
- from app.databases.postgres import Database
451
+ from .app.databases.postgres import Database
450
452
  md_uri = str(settings.Session().bind.url).replace('postgresql+psycopg2', 'postgres')
451
453
  asyncio.run(Database.setup(md_uri))
452
454
  print('Database setup complete')
@@ -460,7 +462,7 @@ class AirflowChatView(AppBuilderBaseView):
460
462
  })
461
463
  else:
462
464
  return jsonify({
463
- "error": "Failed to initialize chat session"
465
+ "error": f"Failed to initialize chat session: {cookies}"
464
466
  }), 500
465
467
 
466
468
  except Exception as e:
@@ -2,7 +2,7 @@ import os
2
2
 
3
3
  from langgraph.checkpoint.postgres.aio import AsyncPostgresSaver
4
4
 
5
- from app.utils.singleton import Singleton
5
+ from ..utils.singleton import Singleton
6
6
 
7
7
 
8
8
  class Database(metaclass=Singleton):
@@ -2,13 +2,13 @@ import os
2
2
  model_type, model_id = os.environ.get('LLM_MODEL_ID', 'none:none').split(':', 1)
3
3
 
4
4
  if model_type == 'bedrock':
5
- from app.models.inference.bedrock_model import ChatBedrock
5
+ from .inference.bedrock_model import ChatBedrock
6
6
  ChatModel = ChatBedrock
7
7
  elif model_type == 'antropic':
8
- from app.models.inference.antropic_model import ChatAnthropic
8
+ from .inference.antropic_model import ChatAnthropic
9
9
  ChatModel = ChatAnthropic
10
10
  elif model_type == 'openai':
11
- from app.models.inference.openai_model import ChatOpenAI
11
+ from .inference.openai_model import ChatOpenAI
12
12
  ChatModel = ChatOpenAI
13
13
  else:
14
14
  ChatModel = None
@@ -3,7 +3,7 @@ import uuid
3
3
  from fastapi import APIRouter, Request
4
4
  from fastapi.responses import StreamingResponse
5
5
  from pydantic import BaseModel
6
- from app.server.llm import get_stream_agent_responce
6
+ from .llm import get_stream_agent_responce
7
7
 
8
8
 
9
9
  chat_router = APIRouter()
@@ -6,9 +6,9 @@ from langgraph.prebuilt import create_react_agent
6
6
  from langchain_core.messages import HumanMessage, BaseMessage, \
7
7
  SystemMessage, ToolMessage, AIMessage, AIMessageChunk
8
8
 
9
- from app.databases.postgres import Database
10
- from app.models import ChatModel
11
- from app.utils.logger import Logger
9
+ from ..databases.postgres import Database
10
+ from ..models import ChatModel
11
+ from ..utils.logger import Logger
12
12
 
13
13
  import os
14
14
 
@@ -5,10 +5,10 @@ from fastapi import FastAPI, Request
5
5
  from fastapi.responses import JSONResponse
6
6
  from starlette.middleware.sessions import SessionMiddleware
7
7
 
8
- from app.server.chat import chat_router
9
- from app.databases.postgres import Database
10
- from app.utils.config import Config
11
- from app.utils.logger import Logger
8
+ from .chat import chat_router
9
+ from ..databases.postgres import Database
10
+ from ..utils.config import Config
11
+ from ..utils.logger import Logger
12
12
 
13
13
 
14
14
  @asynccontextmanager
@@ -1,6 +1,6 @@
1
1
  import os
2
2
 
3
- from app.utils.singleton import Singleton
3
+ from ..utils.singleton import Singleton
4
4
 
5
5
 
6
6
  class Config(metaclass=Singleton):
@@ -1,7 +1,7 @@
1
1
  import sys
2
2
  import logging
3
3
 
4
- from app.utils.singleton import Singleton
4
+ from ..utils.singleton import Singleton
5
5
 
6
6
 
7
7
  class Logger(metaclass=Singleton):
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "airflow-chat"
3
- version = "0.1.0a2"
3
+ version = "0.1.0a4"
4
4
  description = "An Apache Airflow plugin that enables AI-powered chat interactions with your Airflow instance through MCP integration and an intuitive UI."
5
5
  license = "MIT"
6
6
  authors = ["Hipposys"]
File without changes