airflow-chat 0.1.0a3__py3-none-any.whl → 0.1.0a4__py3-none-any.whl
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.
- airflow_chat/plugins/airflow_chat.py +9 -7
- airflow_chat/plugins/app/databases/postgres.py +1 -1
- airflow_chat/plugins/app/models/__init__.py +3 -3
- airflow_chat/plugins/app/server/chat.py +1 -1
- airflow_chat/plugins/app/server/llm.py +3 -3
- airflow_chat/plugins/app/server/main.py +4 -4
- airflow_chat/plugins/app/utils/config.py +1 -1
- airflow_chat/plugins/app/utils/logger.py +1 -1
- {airflow_chat-0.1.0a3.dist-info → airflow_chat-0.1.0a4.dist-info}/METADATA +1 -1
- {airflow_chat-0.1.0a3.dist-info → airflow_chat-0.1.0a4.dist-info}/RECORD +13 -13
- airflow_chat-0.1.0a4.dist-info/entry_points.txt +3 -0
- airflow_chat-0.1.0a3.dist-info/entry_points.txt +0 -3
- {airflow_chat-0.1.0a3.dist-info → airflow_chat-0.1.0a4.dist-info}/LICENSE +0 -0
- {airflow_chat-0.1.0a3.dist-info → airflow_chat-0.1.0a4.dist-info}/WHEEL +0 -0
@@ -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,
|
254
|
+
return False, e
|
255
255
|
except Exception as e:
|
256
256
|
print(f"Unexpected error initializing session: {e}")
|
257
|
-
return False,
|
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
|
-
|
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,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
|
5
|
+
from .inference.bedrock_model import ChatBedrock
|
6
6
|
ChatModel = ChatBedrock
|
7
7
|
elif model_type == 'antropic':
|
8
|
-
from
|
8
|
+
from .inference.antropic_model import ChatAnthropic
|
9
9
|
ChatModel = ChatAnthropic
|
10
10
|
elif model_type == 'openai':
|
11
|
-
from
|
11
|
+
from .inference.openai_model import ChatOpenAI
|
12
12
|
ChatModel = ChatOpenAI
|
13
13
|
else:
|
14
14
|
ChatModel = None
|
@@ -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
|
10
|
-
from
|
11
|
-
from
|
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
|
9
|
-
from
|
10
|
-
from
|
11
|
-
from
|
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,26 +1,26 @@
|
|
1
1
|
airflow_chat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
airflow_chat/plugins/README.md,sha256=Hwmn7ohaPBIoeww2xQ_aSeB6Fy_EgkHXA3LYFi8beIk,21
|
3
3
|
airflow_chat/plugins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
-
airflow_chat/plugins/airflow_chat.py,sha256=
|
4
|
+
airflow_chat/plugins/airflow_chat.py,sha256=WEKwQ2KSRtcEwbvK6DCIiB8Zw4W6COSRveJqCzpGHuA,19728
|
5
5
|
airflow_chat/plugins/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
6
|
airflow_chat/plugins/app/databases/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
|
-
airflow_chat/plugins/app/databases/postgres.py,sha256=
|
8
|
-
airflow_chat/plugins/app/models/__init__.py,sha256=
|
7
|
+
airflow_chat/plugins/app/databases/postgres.py,sha256=YfM7scHesKDJ5JS3qjMVOCMT96Nn8tdtNBy7lsGFpIM,1285
|
8
|
+
airflow_chat/plugins/app/models/__init__.py,sha256=9mNNM5KkN-W6EN_Mo706CKeyTFkyucpYuv_RPOwizbg,452
|
9
9
|
airflow_chat/plugins/app/models/inference/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
10
|
airflow_chat/plugins/app/models/inference/antropic_model.py,sha256=8kC7cXjzGiy77eDnetq7h9SEfUfIEid4T6_2Hd8E5Hc,509
|
11
11
|
airflow_chat/plugins/app/models/inference/bedrock_model.py,sha256=8ebK4oNwqIqhEIBSkVqzNcfQpU2-RtW9KJ_Lxd7yYqA,595
|
12
12
|
airflow_chat/plugins/app/models/inference/openai_model.py,sha256=8iNDgJRXBDP9HR9rMFwYKg-paUUQK2NBJw25ZY0EFWk,534
|
13
13
|
airflow_chat/plugins/app/server/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
14
|
-
airflow_chat/plugins/app/server/chat.py,sha256=
|
15
|
-
airflow_chat/plugins/app/server/llm.py,sha256=
|
16
|
-
airflow_chat/plugins/app/server/main.py,sha256=
|
14
|
+
airflow_chat/plugins/app/server/chat.py,sha256=t9Ft2XGyUDkPye-Tu84J03xlZWdZJFLHZS8epqJAleo,1044
|
15
|
+
airflow_chat/plugins/app/server/llm.py,sha256=yz0mMOs5uGcHX0AjPi3fjP-C1CPAOfjnDBZMFBtYmsw,8719
|
16
|
+
airflow_chat/plugins/app/server/main.py,sha256=BqNf74KdFs5SzHnF9PWhYe807yYfUmEUsodRNc33rOQ,1272
|
17
17
|
airflow_chat/plugins/app/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
18
|
-
airflow_chat/plugins/app/utils/config.py,sha256=
|
19
|
-
airflow_chat/plugins/app/utils/logger.py,sha256=
|
18
|
+
airflow_chat/plugins/app/utils/config.py,sha256=lcUf2GMuXakDuWfyeDKglH5U4t7mQeHnsp3Uk0Es1iM,313
|
19
|
+
airflow_chat/plugins/app/utils/logger.py,sha256=VWHwDOgHODs7RCpeHQcKAjTiwDFJHXt87ozvPcD6onQ,1054
|
20
20
|
airflow_chat/plugins/app/utils/singleton.py,sha256=bQCsVc8XPpM6etUbbg2_bKKReCjLm0bFh6OgXmoBO0I,1789
|
21
21
|
airflow_chat/plugins/templates/chat_interface.html,sha256=ZnMeIeaknXf7ZQI7PRV6fyxyzMsOMUz8KmMaX4k_mJo,18719
|
22
|
-
airflow_chat-0.1.
|
23
|
-
airflow_chat-0.1.
|
24
|
-
airflow_chat-0.1.
|
25
|
-
airflow_chat-0.1.
|
26
|
-
airflow_chat-0.1.
|
22
|
+
airflow_chat-0.1.0a4.dist-info/LICENSE,sha256=XFYCNJc3ykWUpIIuB6uHwgnWKWUm3iez5vxgFF352as,1069
|
23
|
+
airflow_chat-0.1.0a4.dist-info/METADATA,sha256=wJqB4QAO30QA8JKyLMusPnOEzJnu1UnY6uwAqgQT3zE,1605
|
24
|
+
airflow_chat-0.1.0a4.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
25
|
+
airflow_chat-0.1.0a4.dist-info/entry_points.txt,sha256=KzmeXDfhihgaLTQgh4vOz2ts7obTzZCg8CNgkHX1zaU,91
|
26
|
+
airflow_chat-0.1.0a4.dist-info/RECORD,,
|
File without changes
|
File without changes
|