PraisonAI 2.2.25__cp313-cp313-manylinux_2_39_x86_64.whl → 2.2.26__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/ui/components/aicoder.py +16 -1
- praisonai/ui/realtime.py +3 -3
- praisonai/ui/realtimeclient/__init__.py +19 -4
- praisonai/ui/realtimeclient/tools.py +8 -2
- {praisonai-2.2.25.dist-info → praisonai-2.2.26.dist-info}/METADATA +2 -2
- {praisonai-2.2.25.dist-info → praisonai-2.2.26.dist-info}/RECORD +9 -9
- {praisonai-2.2.25.dist-info → praisonai-2.2.26.dist-info}/WHEEL +0 -0
- {praisonai-2.2.25.dist-info → praisonai-2.2.26.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.26 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
|
|
|
@@ -2,6 +2,7 @@ import os
|
|
|
2
2
|
import asyncio
|
|
3
3
|
from pathlib import Path
|
|
4
4
|
import difflib
|
|
5
|
+
import platform
|
|
5
6
|
from typing import Dict, Any
|
|
6
7
|
from litellm import acompletion
|
|
7
8
|
import json
|
|
@@ -119,10 +120,24 @@ class AICoder:
|
|
|
119
120
|
except:
|
|
120
121
|
return None
|
|
121
122
|
|
|
123
|
+
def get_shell_command(self, command: str) -> str:
|
|
124
|
+
"""
|
|
125
|
+
Convert command to be cross-platform compatible.
|
|
126
|
+
On Windows, use cmd /c for shell commands.
|
|
127
|
+
On Unix-like systems, use the command as-is.
|
|
128
|
+
"""
|
|
129
|
+
if platform.system() == "Windows":
|
|
130
|
+
# For Windows, escape quotes and wrap command in cmd /c
|
|
131
|
+
escaped_command = command.replace('"', '\\"')
|
|
132
|
+
return f'cmd /c "{escaped_command}"'
|
|
133
|
+
return command
|
|
134
|
+
|
|
122
135
|
async def execute_command(self, command: str):
|
|
123
136
|
try:
|
|
137
|
+
# Make command cross-platform compatible
|
|
138
|
+
shell_command = self.get_shell_command(command)
|
|
124
139
|
process = await asyncio.create_subprocess_shell(
|
|
125
|
-
|
|
140
|
+
shell_command,
|
|
126
141
|
stdout=asyncio.subprocess.PIPE,
|
|
127
142
|
stderr=asyncio.subprocess.PIPE,
|
|
128
143
|
cwd=self.cwd
|
praisonai/ui/realtime.py
CHANGED
|
@@ -229,7 +229,7 @@ except Exception as e:
|
|
|
229
229
|
@cl.on_chat_start
|
|
230
230
|
async def start():
|
|
231
231
|
initialize_db()
|
|
232
|
-
model_name = os.getenv("MODEL_NAME", "gpt-4o-mini-realtime-preview-2024-12-17")
|
|
232
|
+
model_name = os.getenv("OPENAI_MODEL_NAME") or os.getenv("MODEL_NAME", "gpt-4o-mini-realtime-preview-2024-12-17")
|
|
233
233
|
cl.user_session.set("model_name", model_name)
|
|
234
234
|
cl.user_session.set("message_history", []) # Initialize message history
|
|
235
235
|
logger.debug(f"Model name: {model_name}")
|
|
@@ -382,7 +382,7 @@ async def on_audio_start():
|
|
|
382
382
|
openai_realtime = cl.user_session.get("openai_realtime")
|
|
383
383
|
|
|
384
384
|
if not openai_realtime.is_connected():
|
|
385
|
-
model_name = cl.user_session.get("model_name", "gpt-4o-mini-realtime-preview-2024-12-17")
|
|
385
|
+
model_name = cl.user_session.get("model_name") or os.getenv("OPENAI_MODEL_NAME") or os.getenv("MODEL_NAME", "gpt-4o-mini-realtime-preview-2024-12-17")
|
|
386
386
|
await openai_realtime.connect(model_name)
|
|
387
387
|
|
|
388
388
|
logger.info("Connected to OpenAI realtime")
|
|
@@ -435,7 +435,7 @@ def auth_callback(username: str, password: str):
|
|
|
435
435
|
@cl.on_chat_resume
|
|
436
436
|
async def on_chat_resume(thread: ThreadDict):
|
|
437
437
|
logger.info(f"Resuming chat: {thread['id']}")
|
|
438
|
-
model_name = os.getenv("MODEL_NAME") or "gpt-4o-mini-realtime-preview-2024-12-17"
|
|
438
|
+
model_name = os.getenv("OPENAI_MODEL_NAME") or os.getenv("MODEL_NAME") or "gpt-4o-mini-realtime-preview-2024-12-17"
|
|
439
439
|
logger.debug(f"Model name: {model_name}")
|
|
440
440
|
settings = cl.ChatSettings(
|
|
441
441
|
[
|
|
@@ -93,7 +93,22 @@ class RealtimeAPI(RealtimeEventHandler):
|
|
|
93
93
|
def __init__(self, url=None, api_key=None):
|
|
94
94
|
super().__init__()
|
|
95
95
|
self.default_url = 'wss://api.openai.com/v1/realtime'
|
|
96
|
-
|
|
96
|
+
|
|
97
|
+
# Support custom base URL from environment variable
|
|
98
|
+
base_url = os.getenv("OPENAI_BASE_URL")
|
|
99
|
+
if base_url:
|
|
100
|
+
# Convert HTTP/HTTPS base URL to WebSocket URL for realtime API
|
|
101
|
+
if base_url.startswith('https://'):
|
|
102
|
+
ws_url = base_url.replace('https://', 'wss://').rstrip('/') + '/realtime'
|
|
103
|
+
elif base_url.startswith('http://'):
|
|
104
|
+
ws_url = base_url.replace('http://', 'ws://').rstrip('/') + '/realtime'
|
|
105
|
+
else:
|
|
106
|
+
# Assume it's already a WebSocket URL
|
|
107
|
+
ws_url = base_url.rstrip('/') + '/realtime' if not base_url.endswith('/realtime') else base_url
|
|
108
|
+
self.url = url or ws_url
|
|
109
|
+
else:
|
|
110
|
+
self.url = url or self.default_url
|
|
111
|
+
|
|
97
112
|
self.api_key = api_key or os.getenv("OPENAI_API_KEY")
|
|
98
113
|
self.ws = None
|
|
99
114
|
|
|
@@ -559,9 +574,9 @@ class RealtimeClient(RealtimeEventHandler):
|
|
|
559
574
|
if self.is_connected():
|
|
560
575
|
raise Exception("Already connected, use .disconnect() first")
|
|
561
576
|
|
|
562
|
-
# Use provided model or default
|
|
577
|
+
# Use provided model, OPENAI_MODEL_NAME environment variable, or default
|
|
563
578
|
if model is None:
|
|
564
|
-
model = 'gpt-4o-mini-realtime-preview-2024-12-17'
|
|
579
|
+
model = os.getenv("OPENAI_MODEL_NAME", 'gpt-4o-mini-realtime-preview-2024-12-17')
|
|
565
580
|
|
|
566
581
|
await self.realtime.connect(model)
|
|
567
582
|
await self.update_session()
|
|
@@ -732,7 +747,7 @@ class RealtimeClient(RealtimeEventHandler):
|
|
|
732
747
|
if not self.is_connected():
|
|
733
748
|
try:
|
|
734
749
|
logger.info("Attempting to reconnect to OpenAI Realtime API...")
|
|
735
|
-
model = 'gpt-4o-mini-realtime-preview-2024-12-17'
|
|
750
|
+
model = os.getenv("OPENAI_MODEL_NAME", 'gpt-4o-mini-realtime-preview-2024-12-17')
|
|
736
751
|
await self.connect(model)
|
|
737
752
|
return True
|
|
738
753
|
except Exception as e:
|
|
@@ -22,8 +22,14 @@ logger.setLevel(log_level)
|
|
|
22
22
|
tavily_api_key = os.getenv("TAVILY_API_KEY")
|
|
23
23
|
tavily_client = TavilyClient(api_key=tavily_api_key) if tavily_api_key else None
|
|
24
24
|
|
|
25
|
-
# Set up OpenAI client
|
|
26
|
-
|
|
25
|
+
# Set up OpenAI client with support for custom base URL
|
|
26
|
+
openai_base_url = os.getenv("OPENAI_BASE_URL")
|
|
27
|
+
openai_api_key = os.getenv("OPENAI_API_KEY")
|
|
28
|
+
|
|
29
|
+
if openai_base_url:
|
|
30
|
+
openai_client = OpenAI(base_url=openai_base_url, api_key=openai_api_key)
|
|
31
|
+
else:
|
|
32
|
+
openai_client = OpenAI(api_key=openai_api_key)
|
|
27
33
|
|
|
28
34
|
query_stock_price_def = {
|
|
29
35
|
"name": "query_stock_price",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: PraisonAI
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.26
|
|
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
6
|
Requires-Python: >=3.10
|
|
@@ -64,7 +64,7 @@ Requires-Dist: playwright (>=1.47.0) ; extra == "code"
|
|
|
64
64
|
Requires-Dist: plotly (>=5.24.0) ; extra == "realtime"
|
|
65
65
|
Requires-Dist: praisonai-tools (>=0.0.15) ; extra == "autogen"
|
|
66
66
|
Requires-Dist: praisonai-tools (>=0.0.15) ; extra == "crewai"
|
|
67
|
-
Requires-Dist: praisonaiagents (>=0.0.
|
|
67
|
+
Requires-Dist: praisonaiagents (>=0.0.97)
|
|
68
68
|
Requires-Dist: pyautogen (>=0.2.19) ; extra == "autogen"
|
|
69
69
|
Requires-Dist: pydantic (<=2.10.1) ; extra == "chat"
|
|
70
70
|
Requires-Dist: pydantic (<=2.10.1) ; extra == "code"
|
|
@@ -6,7 +6,7 @@ praisonai/api/call.py,sha256=-dV9DKNDi4w9vN6K63TUh15_PC0M5KzYOmBqHbuJqq0,11079
|
|
|
6
6
|
praisonai/auto.py,sha256=0omuyIIuu-zBAXpsGo3JwuhX6zpjQg3ZtqbPtF5LZbg,12331
|
|
7
7
|
praisonai/chainlit_ui.py,sha256=VKf_--cONLIBMymMY8j-oj6Pq_rw3pHtXOqF2wZ9gYI,12220
|
|
8
8
|
praisonai/cli.py,sha256=LK6__iJP9jr1QAmG7E4kDbmlYqKIRivu9GedfBRz0_w,36311
|
|
9
|
-
praisonai/deploy.py,sha256=
|
|
9
|
+
praisonai/deploy.py,sha256=hrwFyJUkKJY5jOuHI4N5fSrE45QnxP9E2eIDK9yNeJI,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
|
|
@@ -44,7 +44,7 @@ praisonai/ui/chat.py,sha256=mfNU-fmJt4-x3sKe10DuiieOTZYsP5046yGlZq3yVI0,13570
|
|
|
44
44
|
praisonai/ui/code.py,sha256=W4lNfbHTl6VeVYCdGi1T3qOL8VN4guUVKA68ZUCunJU,16665
|
|
45
45
|
praisonai/ui/colab.py,sha256=A2NceDVazMy53mIpp-NIn5w3y8aQKwQu5LmHTepVwlo,19584
|
|
46
46
|
praisonai/ui/colab_chainlit.py,sha256=wrB1O0ttRlmOH8aMxU8QdGpse-X54U87ZcEEA3R1aFg,2432
|
|
47
|
-
praisonai/ui/components/aicoder.py,sha256=
|
|
47
|
+
praisonai/ui/components/aicoder.py,sha256=kcO0jLZVFnA3TP8-WZnSYrIQMpFTwqeByxwOhreMX-A,11781
|
|
48
48
|
praisonai/ui/config/chainlit.md,sha256=YCjGjkKOeW0w711tkAdEfC6sPgBRm6G3bxYPFeHx72U,28
|
|
49
49
|
praisonai/ui/config/translations/bn.json,sha256=m2TAaGMS-18_siW5dw4sbosh0Wn8ENWWzdGYkHaBrXw,22679
|
|
50
50
|
praisonai/ui/config/translations/en-US.json,sha256=QoQAg8P5Q5gbGASc-HAHcfhufk71-Uc1u_ewIBfHuLc,9821
|
|
@@ -67,14 +67,14 @@ praisonai/ui/public/logo_light.png,sha256=8cQRti_Ysa30O3_7C3ku2w40LnVUUlUok47H-3
|
|
|
67
67
|
praisonai/ui/public/movie.svg,sha256=aJ2EQ8vXZusVsF2SeuAVxP4RFJzQ14T26ejrGYdBgzk,1289
|
|
68
68
|
praisonai/ui/public/praison.css,sha256=fBYbJn4Uuv2AH6ThWkMmdAy_uBbw9a9ZeW0hIGsqotA,75
|
|
69
69
|
praisonai/ui/public/thriller.svg,sha256=2dYY72EcgbEyTxS4QzjAm37Y4srtPWEW4vCMFki98ZI,3163
|
|
70
|
-
praisonai/ui/realtime.py,sha256
|
|
71
|
-
praisonai/ui/realtimeclient/__init__.py,sha256=
|
|
72
|
-
praisonai/ui/realtimeclient/tools.py,sha256=
|
|
70
|
+
praisonai/ui/realtime.py,sha256=-Tf9gSIQgQEsppHtt4cjI0tqSZT1dsPDEQK1mmUzFOw,18482
|
|
71
|
+
praisonai/ui/realtimeclient/__init__.py,sha256=uAsEOveayAQRRrZ3P6ws46hjpszXBPfMc45dIVF4ZHk,32334
|
|
72
|
+
praisonai/ui/realtimeclient/tools.py,sha256=H0_m0z9-x9R4zV8Q_2Ky6UjF5cxCXjCYSTFsdBs8Nkc,8619
|
|
73
73
|
praisonai/ui/sql_alchemy.py,sha256=ilWAWicUGja7ADbXW9_OgIYeyKNuAQ1ZI_RMqjmMI9k,29667
|
|
74
74
|
praisonai/ui/tools.md,sha256=Ad3YH_ZCLMWlz3mDXllQnQ_S5l55LWqLdcZSh-EXrHI,3956
|
|
75
75
|
praisonai/upload_vision.py,sha256=lMpFn993UiYVJxRNZQTmcbPbEajQ5TFKCNGK1Icn_hg,5253
|
|
76
76
|
praisonai/version.py,sha256=ugyuFliEqtAwQmH4sTlc16YXKYbFWDmfyk87fErB8-8,21
|
|
77
|
-
praisonai-2.2.
|
|
78
|
-
praisonai-2.2.
|
|
79
|
-
praisonai-2.2.
|
|
80
|
-
praisonai-2.2.
|
|
77
|
+
praisonai-2.2.26.dist-info/METADATA,sha256=mrwTOT67VANYlvoAwWpOpAfj8Bq-M5DS3oVGeBnQ2UU,4761
|
|
78
|
+
praisonai-2.2.26.dist-info/WHEEL,sha256=dCzwOzx-VmbmLA5u8QpkARaxx3rsePBxa1nmZphhNQk,110
|
|
79
|
+
praisonai-2.2.26.dist-info/entry_points.txt,sha256=QSSfuXjZMhf16FZ201I_oSoX_s1nWYbi_4_UXPE3S-o,145
|
|
80
|
+
praisonai-2.2.26.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|