PraisonAI 2.0.37__cp312-cp312-manylinux_2_39_x86_64.whl → 2.0.38__cp312-cp312-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 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.0.37 gunicorn markdown\n")
59
+ file.write("RUN pip install flask praisonai==2.0.38 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/ui/realtime.py CHANGED
@@ -186,11 +186,42 @@ try:
186
186
  if custom_tools_module:
187
187
  # Update the tools list with custom tools
188
188
  if hasattr(custom_tools_module, 'tools') and isinstance(custom_tools_module.tools, list):
189
- tools.extend(custom_tools_module.tools)
189
+ # Only add tools that have proper function definitions
190
+ for tool in custom_tools_module.tools:
191
+ if isinstance(tool, tuple) and len(tool) == 2:
192
+ tool_def, handler = tool
193
+ if isinstance(tool_def, dict) and "type" in tool_def and tool_def["type"] == "function":
194
+ # Convert class/function to proper tool definition
195
+ if "function" in tool_def:
196
+ func = tool_def["function"]
197
+ if hasattr(func, "__name__"):
198
+ tool_def = {
199
+ "name": func.__name__,
200
+ "description": func.__doc__ or f"Execute {func.__name__}",
201
+ "parameters": {
202
+ "type": "object",
203
+ "properties": {},
204
+ "required": []
205
+ }
206
+ }
207
+ tools.append((tool_def, handler))
208
+ else:
209
+ # Tool definition is already properly formatted
210
+ tools.append(tool)
190
211
  else:
212
+ # Process individual functions/classes
191
213
  for name, obj in custom_tools_module.__dict__.items():
192
214
  if callable(obj) and not name.startswith("__"):
193
- tools.append(({"type": "function", "function": obj}, obj))
215
+ tool_def = {
216
+ "name": name,
217
+ "description": obj.__doc__ or f"Execute {name}",
218
+ "parameters": {
219
+ "type": "object",
220
+ "properties": {},
221
+ "required": []
222
+ }
223
+ }
224
+ tools.append((tool_def, obj))
194
225
 
195
226
  except Exception as e:
196
227
  logger.warning(f"Error importing custom tools: {str(e)}. Continuing without custom tools.")
@@ -287,14 +318,30 @@ async def setup_openai_realtime():
287
318
  logger.error(event)
288
319
  await cl.Message(content=f"Error: {event}", author="System").send()
289
320
 
321
+ # Register event handlers
290
322
  openai_realtime.on('conversation.updated', handle_conversation_updated)
291
323
  openai_realtime.on('conversation.item.completed', handle_item_completed)
292
324
  openai_realtime.on('conversation.interrupted', handle_conversation_interrupt)
293
325
  openai_realtime.on('error', handle_error)
294
326
 
295
327
  cl.user_session.set("openai_realtime", openai_realtime)
296
- coros = [openai_realtime.add_tool(tool_def, tool_handler) for tool_def, tool_handler in tools]
297
- await asyncio.gather(*coros)
328
+
329
+ # Filter out invalid tools and add valid ones
330
+ valid_tools = []
331
+ for tool_def, tool_handler in tools:
332
+ try:
333
+ if isinstance(tool_def, dict) and "name" in tool_def:
334
+ valid_tools.append((tool_def, tool_handler))
335
+ else:
336
+ logger.warning(f"Skipping invalid tool definition: {tool_def}")
337
+ except Exception as e:
338
+ logger.warning(f"Error processing tool: {e}")
339
+
340
+ if valid_tools:
341
+ coros = [openai_realtime.add_tool(tool_def, tool_handler) for tool_def, tool_handler in valid_tools]
342
+ await asyncio.gather(*coros)
343
+ else:
344
+ logger.warning("No valid tools found to add")
298
345
 
299
346
  @cl.on_settings_update
300
347
  async def setup_agent(settings):
@@ -330,11 +377,19 @@ async def setup_agent(settings):
330
377
  async def on_audio_start():
331
378
  try:
332
379
  openai_realtime: RealtimeClient = cl.user_session.get("openai_realtime")
333
- await openai_realtime.connect()
380
+ if not openai_realtime:
381
+ await setup_openai_realtime()
382
+ openai_realtime = cl.user_session.get("openai_realtime")
383
+
384
+ if not openai_realtime.is_connected():
385
+ await openai_realtime.connect()
386
+
334
387
  logger.info("Connected to OpenAI realtime")
335
388
  return True
336
389
  except Exception as e:
337
- await cl.ErrorMessage(content=f"Failed to connect to OpenAI realtime: {e}").send()
390
+ error_msg = f"Failed to connect to OpenAI realtime: {str(e)}"
391
+ logger.error(error_msg)
392
+ await cl.ErrorMessage(content=error_msg).send()
338
393
  return False
339
394
 
340
395
  @cl.on_audio_chunk
@@ -9,7 +9,8 @@ import os
9
9
  import aiofiles
10
10
  import aiohttp
11
11
 
12
- from chainlit.data.base import BaseDataLayer, BaseStorageClient
12
+ from chainlit.data.base import BaseDataLayer
13
+ from chainlit.data.storage_clients.base import EXPIRY_TIME, BaseStorageClient
13
14
  from chainlit.data.utils import queue_until_user_message
14
15
  from chainlit.element import ElementDict
15
16
  from chainlit.logger import logger
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: PraisonAI
3
- Version: 2.0.37
3
+ Version: 2.0.38
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,<3.13
@@ -28,10 +28,10 @@ Requires-Dist: aiosqlite (>=0.20.0) ; extra == "chat"
28
28
  Requires-Dist: aiosqlite (>=0.20.0) ; extra == "code"
29
29
  Requires-Dist: aiosqlite (>=0.20.0) ; extra == "realtime"
30
30
  Requires-Dist: aiosqlite (>=0.20.0) ; extra == "ui"
31
- Requires-Dist: chainlit (==1.3.2) ; extra == "chat"
32
- Requires-Dist: chainlit (==1.3.2) ; extra == "code"
33
- Requires-Dist: chainlit (==1.3.2) ; extra == "realtime"
34
- Requires-Dist: chainlit (==1.3.2) ; extra == "ui"
31
+ Requires-Dist: chainlit (==2.0.1) ; extra == "chat"
32
+ Requires-Dist: chainlit (==2.0.1) ; extra == "code"
33
+ Requires-Dist: chainlit (==2.0.1) ; extra == "realtime"
34
+ Requires-Dist: chainlit (==2.0.1) ; extra == "ui"
35
35
  Requires-Dist: crawl4ai (==0.3.4) ; extra == "chat"
36
36
  Requires-Dist: crawl4ai (==0.3.4) ; extra == "code"
37
37
  Requires-Dist: crawl4ai (==0.3.4) ; extra == "realtime"
@@ -61,7 +61,7 @@ Requires-Dist: playwright (>=1.47.0) ; extra == "code"
61
61
  Requires-Dist: plotly (>=5.24.0) ; extra == "realtime"
62
62
  Requires-Dist: praisonai-tools (>=0.0.7) ; extra == "autogen"
63
63
  Requires-Dist: praisonai-tools (>=0.0.7) ; extra == "crewai"
64
- Requires-Dist: praisonaiagents (>=0.0.28)
64
+ Requires-Dist: praisonaiagents (>=0.0.30)
65
65
  Requires-Dist: pyautogen (>=0.2.19) ; extra == "autogen"
66
66
  Requires-Dist: pydantic (<=2.10.1) ; extra == "chat"
67
67
  Requires-Dist: pydantic (<=2.10.1) ; extra == "code"
@@ -5,7 +5,7 @@ praisonai/api/call.py,sha256=iHdAlgIH_oTsEbjaGGu1Jjo6DTfMR-SfFdtSxnOLCeY,11032
5
5
  praisonai/auto.py,sha256=uLDm8CU3L_3amZsd55yzf9RdBF1uW-BGSx7nl9ctNZ4,8680
6
6
  praisonai/chainlit_ui.py,sha256=bNR7s509lp0I9JlJNvwCZRUZosC64qdvlFCt8NmFamQ,12216
7
7
  praisonai/cli.py,sha256=M69ji9gQGzWVLewNhTwH5kYZuj63TzlcishxoRx18ug,21210
8
- praisonai/deploy.py,sha256=Wg-p0VvVheeVtqqKYYI6kKmnAX21OQe6iPaMNjY3a-U,6028
8
+ praisonai/deploy.py,sha256=T7DLT1BdHV6pQVUTxV37ffpK5O9_Asht2neLjmgyKKw,6028
9
9
  praisonai/inbuilt_tools/__init__.py,sha256=fai4ZJIKz7-iOnGZv5jJX0wmT77PKa4x2jqyaJddKFA,569
10
10
  praisonai/inbuilt_tools/autogen_tools.py,sha256=kJdEv61BTYvdHOaURNEpBcWq8Rs-oC03loNFTIjT-ak,4687
11
11
  praisonai/inc/__init__.py,sha256=sPDlYBBwdk0VlWzaaM_lG0_LD07lS2HRGvPdxXJFiYg,62
@@ -75,15 +75,15 @@ praisonai/ui/public/logo_light.png,sha256=8cQRti_Ysa30O3_7C3ku2w40LnVUUlUok47H-3
75
75
  praisonai/ui/public/movie.svg,sha256=aJ2EQ8vXZusVsF2SeuAVxP4RFJzQ14T26ejrGYdBgzk,1289
76
76
  praisonai/ui/public/praison.css,sha256=fBYbJn4Uuv2AH6ThWkMmdAy_uBbw9a9ZeW0hIGsqotA,75
77
77
  praisonai/ui/public/thriller.svg,sha256=2dYY72EcgbEyTxS4QzjAm37Y4srtPWEW4vCMFki98ZI,3163
78
- praisonai/ui/realtime.py,sha256=qpgcGA8CIUfYuSXtQM0zSlxktFtUZXsryn0Tru-R5wU,15304
78
+ praisonai/ui/realtime.py,sha256=WyuIQ6c2zDRoPT4NBbD692vtKX8y31vTUfsTT4rngv0,17777
79
79
  praisonai/ui/realtimeclient/__init__.py,sha256=zA2xa7rBUSw77wFkndJMQNNPqdH6ywQ3uf4WSYHjNfs,27513
80
80
  praisonai/ui/realtimeclient/realtimedocs.txt,sha256=hmgd8Uwy2SkjSndyyF_-ZOaNxiyHwGaQLGc67DvV-sI,26395
81
81
  praisonai/ui/realtimeclient/tools.py,sha256=IJOYwVOBW5Ocn5_iV9pFkmSKR3WU3YpX3kwF0I3jikQ,7855
82
- praisonai/ui/sql_alchemy.py,sha256=cfyL9uFfuizKFvW0aZfUBlJWPQYI-YBi1v4vxlkb1BQ,29615
82
+ praisonai/ui/sql_alchemy.py,sha256=oekZOXlRGMJ2SuC-lmgMMIzAmvbMg2DWeGTSpOzbVBM,29674
83
83
  praisonai/ui/tools.md,sha256=Ad3YH_ZCLMWlz3mDXllQnQ_S5l55LWqLdcZSh-EXrHI,3956
84
84
  praisonai/version.py,sha256=ugyuFliEqtAwQmH4sTlc16YXKYbFWDmfyk87fErB8-8,21
85
- praisonai-2.0.37.dist-info/LICENSE,sha256=kqvFysVlnFxYOu0HxCe2HlmZmJtdmNGOxWRRkT9TsWc,1035
86
- praisonai-2.0.37.dist-info/METADATA,sha256=K_v4Mky5GiMWIwgIcGgX9jJum9m3ryrMUimyXA_TQ6E,21774
87
- praisonai-2.0.37.dist-info/WHEEL,sha256=rqU-pzVJ6on7cnU-SP20blBtY1yM7u0ejCbKCZ5K36I,110
88
- praisonai-2.0.37.dist-info/entry_points.txt,sha256=I_xc6a6MNTTfLxYmAxe0rgey0G-_hbY07oFW-ZDnkw4,135
89
- praisonai-2.0.37.dist-info/RECORD,,
85
+ praisonai-2.0.38.dist-info/LICENSE,sha256=kqvFysVlnFxYOu0HxCe2HlmZmJtdmNGOxWRRkT9TsWc,1035
86
+ praisonai-2.0.38.dist-info/METADATA,sha256=YMHXK40aN50nMu0SILpoEZFY4slxZsoIb5WohI8JTtA,21774
87
+ praisonai-2.0.38.dist-info/WHEEL,sha256=rqU-pzVJ6on7cnU-SP20blBtY1yM7u0ejCbKCZ5K36I,110
88
+ praisonai-2.0.38.dist-info/entry_points.txt,sha256=I_xc6a6MNTTfLxYmAxe0rgey0G-_hbY07oFW-ZDnkw4,135
89
+ praisonai-2.0.38.dist-info/RECORD,,