PraisonAI 2.2.17__cp313-cp313-manylinux_2_39_x86_64.whl → 2.2.19__cp313-cp313-manylinux_2_39_x86_64.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.
Potentially problematic release.
This version of PraisonAI might be problematic. Click here for more details.
- praisonai/deploy.py +1 -1
- praisonai/inc/models.py +24 -4
- praisonai/ui/database_config.py +56 -0
- praisonai/ui/db.py +3 -4
- praisonai/ui/sql_alchemy.py +3 -5
- {praisonai-2.2.17.dist-info → praisonai-2.2.19.dist-info}/METADATA +3 -3
- {praisonai-2.2.17.dist-info → praisonai-2.2.19.dist-info}/RECORD +9 -8
- {praisonai-2.2.17.dist-info → praisonai-2.2.19.dist-info}/WHEEL +0 -0
- {praisonai-2.2.17.dist-info → praisonai-2.2.19.dist-info}/entry_points.txt +0 -0
praisonai/deploy.py
CHANGED
|
@@ -56,7 +56,7 @@ class CloudDeployer:
|
|
|
56
56
|
file.write("FROM python:3.11-slim\n")
|
|
57
57
|
file.write("WORKDIR /app\n")
|
|
58
58
|
file.write("COPY . .\n")
|
|
59
|
-
file.write("RUN pip install flask praisonai==2.2.
|
|
59
|
+
file.write("RUN pip install flask praisonai==2.2.19 gunicorn markdown\n")
|
|
60
60
|
file.write("EXPOSE 8080\n")
|
|
61
61
|
file.write('CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]\n')
|
|
62
62
|
|
praisonai/inc/models.py
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
# praisonai/inc/models.py
|
|
2
2
|
import os
|
|
3
3
|
import logging
|
|
4
|
+
from urllib.parse import urlparse
|
|
4
5
|
logger = logging.getLogger(__name__)
|
|
5
6
|
logging.basicConfig(level=os.environ.get('LOGLEVEL', 'INFO').upper(), format='%(asctime)s - %(levelname)s - %(message)s')
|
|
6
7
|
|
|
8
|
+
# Constants
|
|
9
|
+
LOCAL_SERVER_API_KEY_PLACEHOLDER = "not-needed"
|
|
10
|
+
|
|
7
11
|
# Conditionally import modules based on availability
|
|
8
12
|
try:
|
|
9
13
|
from langchain_openai import ChatOpenAI # pip install langchain-openai
|
|
@@ -71,11 +75,27 @@ class PraisonAIModel:
|
|
|
71
75
|
self.model_name = self.model.replace("openrouter/", "")
|
|
72
76
|
else:
|
|
73
77
|
self.api_key_var = api_key_var or "OPENAI_API_KEY"
|
|
74
|
-
self.base_url = base_url or os.environ.get("OPENAI_API_BASE"
|
|
78
|
+
self.base_url = base_url or os.environ.get("OPENAI_API_BASE") or os.environ.get("OPENAI_BASE_URL") or "https://api.openai.com/v1"
|
|
75
79
|
self.model_name = self.model
|
|
76
80
|
logger.debug(f"Initialized PraisonAIModel with model {self.model_name}, api_key_var {self.api_key_var}, and base_url {self.base_url}")
|
|
77
|
-
|
|
78
|
-
|
|
81
|
+
|
|
82
|
+
# Get API key from environment
|
|
83
|
+
self.api_key = api_key or os.environ.get(self.api_key_var)
|
|
84
|
+
|
|
85
|
+
# For local servers, allow placeholder API key if base_url is set to non-OpenAI endpoint
|
|
86
|
+
if not self.api_key and self.base_url:
|
|
87
|
+
parsed_url = urlparse(self.base_url)
|
|
88
|
+
is_local = (parsed_url.hostname in ["localhost", "127.0.0.1"] or
|
|
89
|
+
"api.openai.com" not in self.base_url)
|
|
90
|
+
if is_local:
|
|
91
|
+
self.api_key = LOCAL_SERVER_API_KEY_PLACEHOLDER
|
|
92
|
+
|
|
93
|
+
if not self.api_key:
|
|
94
|
+
raise ValueError(
|
|
95
|
+
f"{self.api_key_var} environment variable is required for the default OpenAI service. "
|
|
96
|
+
f"For local servers, set {self.api_key_var}='{LOCAL_SERVER_API_KEY_PLACEHOLDER}' and OPENAI_API_BASE to your local endpoint."
|
|
97
|
+
)
|
|
98
|
+
|
|
79
99
|
|
|
80
100
|
def get_model(self):
|
|
81
101
|
"""
|
|
@@ -127,4 +147,4 @@ class PraisonAIModel:
|
|
|
127
147
|
raise ImportError(
|
|
128
148
|
"Required Langchain Integration 'langchain-openai' not found. "
|
|
129
149
|
"Please install with 'pip install langchain-openai'"
|
|
130
|
-
)
|
|
150
|
+
)
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Database configuration utilities for PraisonAI UI components.
|
|
3
|
+
|
|
4
|
+
This module provides centralized database configuration functionality,
|
|
5
|
+
particularly for handling the FORCE_SQLITE environment variable.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
import os
|
|
9
|
+
from typing import Optional, Tuple
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def should_force_sqlite() -> bool:
|
|
13
|
+
"""
|
|
14
|
+
Check if FORCE_SQLITE environment variable is set to true.
|
|
15
|
+
|
|
16
|
+
Returns:
|
|
17
|
+
bool: True if FORCE_SQLITE is set to "true" (case-insensitive), False otherwise.
|
|
18
|
+
"""
|
|
19
|
+
return os.getenv("FORCE_SQLITE", "false").lower() == "true"
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def get_database_url_with_sqlite_override() -> Optional[str]:
|
|
23
|
+
"""
|
|
24
|
+
Get database URL respecting FORCE_SQLITE flag.
|
|
25
|
+
|
|
26
|
+
When FORCE_SQLITE=true, this function returns None to force SQLite usage.
|
|
27
|
+
Otherwise, it returns the appropriate database URL from environment variables.
|
|
28
|
+
|
|
29
|
+
Returns:
|
|
30
|
+
Optional[str]: Database URL if external database should be used, None for SQLite.
|
|
31
|
+
"""
|
|
32
|
+
if should_force_sqlite():
|
|
33
|
+
return None
|
|
34
|
+
|
|
35
|
+
database_url = os.getenv("DATABASE_URL")
|
|
36
|
+
supabase_url = os.getenv("SUPABASE_DATABASE_URL")
|
|
37
|
+
return supabase_url if supabase_url else database_url
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def get_database_config_for_sqlalchemy() -> Tuple[Optional[str], Optional[str]]:
|
|
41
|
+
"""
|
|
42
|
+
Get database configuration for SQLAlchemy module respecting FORCE_SQLITE flag.
|
|
43
|
+
|
|
44
|
+
Returns:
|
|
45
|
+
Tuple[Optional[str], Optional[str]]: (DATABASE_URL, SUPABASE_DATABASE_URL)
|
|
46
|
+
Both will be None if FORCE_SQLITE=true, otherwise original values.
|
|
47
|
+
"""
|
|
48
|
+
if should_force_sqlite():
|
|
49
|
+
return None, None
|
|
50
|
+
else:
|
|
51
|
+
database_url = os.getenv("DATABASE_URL")
|
|
52
|
+
supabase_url = os.getenv("SUPABASE_DATABASE_URL")
|
|
53
|
+
# Apply Supabase override logic
|
|
54
|
+
if supabase_url:
|
|
55
|
+
database_url = supabase_url
|
|
56
|
+
return database_url, supabase_url
|
praisonai/ui/db.py
CHANGED
|
@@ -9,6 +9,7 @@ from sqlalchemy.orm import sessionmaker
|
|
|
9
9
|
from sql_alchemy import SQLAlchemyDataLayer
|
|
10
10
|
import chainlit.data as cl_data
|
|
11
11
|
from chainlit.types import ThreadDict
|
|
12
|
+
from database_config import get_database_url_with_sqlite_override
|
|
12
13
|
|
|
13
14
|
def ensure_directories():
|
|
14
15
|
"""Ensure required directories exist"""
|
|
@@ -57,10 +58,8 @@ ensure_directories()
|
|
|
57
58
|
|
|
58
59
|
class DatabaseManager(SQLAlchemyDataLayer):
|
|
59
60
|
def __init__(self):
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
if supabase_url:
|
|
63
|
-
self.database_url = supabase_url
|
|
61
|
+
# Check FORCE_SQLITE flag to bypass external database detection
|
|
62
|
+
self.database_url = get_database_url_with_sqlite_override()
|
|
64
63
|
|
|
65
64
|
if self.database_url:
|
|
66
65
|
self.conninfo = self.database_url
|
praisonai/ui/sql_alchemy.py
CHANGED
|
@@ -29,16 +29,14 @@ from sqlalchemy import text
|
|
|
29
29
|
from sqlalchemy.exc import SQLAlchemyError
|
|
30
30
|
from sqlalchemy.ext.asyncio import AsyncEngine, AsyncSession, create_async_engine
|
|
31
31
|
from sqlalchemy.orm import sessionmaker
|
|
32
|
+
from database_config import get_database_config_for_sqlalchemy
|
|
32
33
|
|
|
33
34
|
if TYPE_CHECKING:
|
|
34
35
|
from chainlit.element import Element
|
|
35
36
|
from chainlit.step import StepDict
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
SUPABASE_DATABASE_URL =
|
|
39
|
-
if SUPABASE_DATABASE_URL:
|
|
40
|
-
# If a Supabase database URL is provided, use it.
|
|
41
|
-
DATABASE_URL = SUPABASE_DATABASE_URL
|
|
38
|
+
# Check FORCE_SQLITE flag to bypass external database detection
|
|
39
|
+
DATABASE_URL, SUPABASE_DATABASE_URL = get_database_config_for_sqlalchemy()
|
|
42
40
|
|
|
43
41
|
class SQLAlchemyDataLayer(BaseDataLayer):
|
|
44
42
|
def __init__(
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: PraisonAI
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.19
|
|
4
4
|
Summary: PraisonAI is an AI Agents Framework with Self Reflection. PraisonAI application combines PraisonAI Agents, AutoGen, and CrewAI into a low-code solution for building and managing multi-agent LLM systems, focusing on simplicity, customisation, and efficient human-agent collaboration.
|
|
5
5
|
Author: Mervin Praison
|
|
6
|
-
Requires-Python: >=3.10
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
7
|
Classifier: Programming Language :: Python :: 3
|
|
8
8
|
Classifier: Programming Language :: Python :: 3.10
|
|
9
9
|
Classifier: Programming Language :: Python :: 3.11
|
|
@@ -63,7 +63,7 @@ Requires-Dist: playwright (>=1.47.0) ; extra == "code"
|
|
|
63
63
|
Requires-Dist: plotly (>=5.24.0) ; extra == "realtime"
|
|
64
64
|
Requires-Dist: praisonai-tools (>=0.0.15) ; extra == "autogen"
|
|
65
65
|
Requires-Dist: praisonai-tools (>=0.0.15) ; extra == "crewai"
|
|
66
|
-
Requires-Dist: praisonaiagents (>=0.0.
|
|
66
|
+
Requires-Dist: praisonaiagents (>=0.0.91)
|
|
67
67
|
Requires-Dist: pyautogen (>=0.2.19) ; extra == "autogen"
|
|
68
68
|
Requires-Dist: pydantic (<=2.10.1) ; extra == "chat"
|
|
69
69
|
Requires-Dist: pydantic (<=2.10.1) ; extra == "code"
|
|
@@ -6,12 +6,12 @@ praisonai/api/call.py,sha256=krOfTCZM_bdbsNuWQ1PijzCHECkDvEi9jIvvZaDQUUU,11035
|
|
|
6
6
|
praisonai/auto.py,sha256=n4rhiNckKv0Vtn2OnhDVVuOBxmm3CpimM9Y-ZVN9H9E,9240
|
|
7
7
|
praisonai/chainlit_ui.py,sha256=VKf_--cONLIBMymMY8j-oj6Pq_rw3pHtXOqF2wZ9gYI,12220
|
|
8
8
|
praisonai/cli.py,sha256=Tw2HT4Orgx4WW6RDB-f9ssvFPdlyJlHTc_3G7Uve060,27893
|
|
9
|
-
praisonai/deploy.py,sha256=
|
|
9
|
+
praisonai/deploy.py,sha256=5hJ0ZmNzCqmv9KKSm-PKi8VixM5x-B_2A-ywQgggMvw,6028
|
|
10
10
|
praisonai/inbuilt_tools/__init__.py,sha256=mZOEximj3zCyJHq9Lz0bGXhQpBsa_QR-R-yA9UKC3zI,565
|
|
11
11
|
praisonai/inbuilt_tools/autogen_tools.py,sha256=kJdEv61BTYvdHOaURNEpBcWq8Rs-oC03loNFTIjT-ak,4687
|
|
12
12
|
praisonai/inc/__init__.py,sha256=sPDlYBBwdk0VlWzaaM_lG0_LD07lS2HRGvPdxXJFiYg,62
|
|
13
13
|
praisonai/inc/config.py,sha256=up2-841ruK7MCUUT3xkWBA5S6WsY0sFODNfcT6Q4Wms,3333
|
|
14
|
-
praisonai/inc/models.py,sha256=
|
|
14
|
+
praisonai/inc/models.py,sha256=hKcyzMxAFWBTnIjk_ngfZUGmb1ubkgqx8I8cJ0Kr_Xc,6556
|
|
15
15
|
praisonai/public/android-chrome-192x192.png,sha256=ENJEqhDE3XEQViRhKNDezQKRiOiuHOUj5nzRN43fz50,6535
|
|
16
16
|
praisonai/public/android-chrome-512x512.png,sha256=4txEwB0cJkxFVarRdvFGJZR1DtWJ2h-L_2cUEjBXHAc,15244
|
|
17
17
|
praisonai/public/apple-touch-icon.png,sha256=YLlEhlenm24QY_yv-5wb_mxDxJ8H22H_S8Khlvz-zVA,6001
|
|
@@ -57,7 +57,8 @@ praisonai/ui/config/translations/ta.json,sha256=8JPW6BwLN2dl9wuq5wSkMvazcY8lM5v1
|
|
|
57
57
|
praisonai/ui/config/translations/te.json,sha256=JzW2YXWg1qqvWgIvEgMelQz5s6EzTb_uD_3TEHAHiQw,23526
|
|
58
58
|
praisonai/ui/config/translations/zh-CN.json,sha256=aLBSSSQ0yojlYGuMMlOYvkD_ruG9-d2AgnjJWhPODVw,11737
|
|
59
59
|
praisonai/ui/context.py,sha256=oWO2I_WBZb7kZnuXItf18EJX0ZQv-1nAd8rxhwhuuDU,11871
|
|
60
|
-
praisonai/ui/
|
|
60
|
+
praisonai/ui/database_config.py,sha256=rW0YRUWom5yC4_5MfHP0fnMG7jHKdDYXvnUZc0JOGPA,1838
|
|
61
|
+
praisonai/ui/db.py,sha256=CLY_fWmy2uwIZNby2Ya7FBvh2o2tKje8fkXAmtRwky4,11450
|
|
61
62
|
praisonai/ui/public/fantasy.svg,sha256=4Gs3kIOux-pjGtw6ogI_rv5_viVJxnE5gRwGilsSg0o,1553
|
|
62
63
|
praisonai/ui/public/game.svg,sha256=y2QMaA01m8XzuDjTOBWzupOC3-TpnUl9ah89mIhviUw,2406
|
|
63
64
|
praisonai/ui/public/logo_dark.png,sha256=frHz1zkrnivGssJgk9iy1cabojkVgm8B4MllFwL_CnI,17050
|
|
@@ -69,11 +70,11 @@ praisonai/ui/realtime.py,sha256=aVK-lbA57J9KHo3Lrknk4aaO1V1tRkiKXr_01zWrl30,1784
|
|
|
69
70
|
praisonai/ui/realtimeclient/__init__.py,sha256=zA2xa7rBUSw77wFkndJMQNNPqdH6ywQ3uf4WSYHjNfs,27513
|
|
70
71
|
praisonai/ui/realtimeclient/realtimedocs.txt,sha256=hmgd8Uwy2SkjSndyyF_-ZOaNxiyHwGaQLGc67DvV-sI,26395
|
|
71
72
|
praisonai/ui/realtimeclient/tools.py,sha256=IJOYwVOBW5Ocn5_iV9pFkmSKR3WU3YpX3kwF0I3jikQ,7855
|
|
72
|
-
praisonai/ui/sql_alchemy.py,sha256=
|
|
73
|
+
praisonai/ui/sql_alchemy.py,sha256=ilWAWicUGja7ADbXW9_OgIYeyKNuAQ1ZI_RMqjmMI9k,29667
|
|
73
74
|
praisonai/ui/tools.md,sha256=Ad3YH_ZCLMWlz3mDXllQnQ_S5l55LWqLdcZSh-EXrHI,3956
|
|
74
75
|
praisonai/upload_vision.py,sha256=lMpFn993UiYVJxRNZQTmcbPbEajQ5TFKCNGK1Icn_hg,5253
|
|
75
76
|
praisonai/version.py,sha256=ugyuFliEqtAwQmH4sTlc16YXKYbFWDmfyk87fErB8-8,21
|
|
76
|
-
praisonai-2.2.
|
|
77
|
-
praisonai-2.2.
|
|
78
|
-
praisonai-2.2.
|
|
79
|
-
praisonai-2.2.
|
|
77
|
+
praisonai-2.2.19.dist-info/METADATA,sha256=p_2qcwKD0mDb0caJqqlyhHF-EChB2oRYI1fih81IOMM,4739
|
|
78
|
+
praisonai-2.2.19.dist-info/WHEEL,sha256=dCzwOzx-VmbmLA5u8QpkARaxx3rsePBxa1nmZphhNQk,110
|
|
79
|
+
praisonai-2.2.19.dist-info/entry_points.txt,sha256=I_xc6a6MNTTfLxYmAxe0rgey0G-_hbY07oFW-ZDnkw4,135
|
|
80
|
+
praisonai-2.2.19.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|