PraisonAI 0.1.1__cp312-cp312-manylinux_2_35_x86_64.whl → 0.1.3__cp312-cp312-manylinux_2_35_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==0.1.1 gunicorn markdown\n")
59
+ file.write("RUN pip install flask praisonai==0.1.3 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
@@ -6,7 +6,6 @@ from uuid import uuid4
6
6
 
7
7
  from openai import AsyncOpenAI
8
8
  import chainlit as cl
9
- from chainlit.logger import logger
10
9
  from chainlit.input_widget import TextInput
11
10
  from chainlit.types import ThreadDict
12
11
 
@@ -16,6 +15,25 @@ from sql_alchemy import SQLAlchemyDataLayer
16
15
  import chainlit.data as cl_data
17
16
  from literalai.helper import utc_now
18
17
  import json
18
+ import logging
19
+ import importlib.util
20
+ from importlib import import_module
21
+ from pathlib import Path
22
+
23
+ # Set up logging
24
+ logger = logging.getLogger(__name__)
25
+ log_level = os.getenv("LOGLEVEL", "INFO").upper()
26
+ logger.handlers = []
27
+
28
+ # Set up logging to console
29
+ console_handler = logging.StreamHandler()
30
+ console_handler.setLevel(log_level)
31
+ console_formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
32
+ console_handler.setFormatter(console_formatter)
33
+ logger.addHandler(console_handler)
34
+
35
+ # Set the logging level for the logger
36
+ logger.setLevel(log_level)
19
37
 
20
38
  # Set up CHAINLIT_AUTH_SECRET
21
39
  CHAINLIT_AUTH_SECRET = os.getenv("CHAINLIT_AUTH_SECRET")
@@ -144,6 +162,39 @@ cl_data._data_layer = SQLAlchemyDataLayer(conninfo=f"sqlite+aiosqlite:///{DB_PAT
144
162
 
145
163
  client = AsyncOpenAI()
146
164
 
165
+ # Try to import tools from the root directory
166
+ tools_path = os.path.join(os.getcwd(), 'tools.py')
167
+ logger.info(f"Tools path: {tools_path}")
168
+
169
+ def import_tools_from_file(file_path):
170
+ spec = importlib.util.spec_from_file_location("custom_tools", file_path)
171
+ custom_tools_module = importlib.util.module_from_spec(spec)
172
+ spec.loader.exec_module(custom_tools_module)
173
+ logger.debug(f"Imported tools from {file_path}")
174
+ logger.debug(f"Tools: {custom_tools_module}")
175
+ return custom_tools_module
176
+
177
+ try:
178
+ if os.path.exists(tools_path):
179
+ # tools.py exists in the root directory, import from file
180
+ custom_tools_module = import_tools_from_file(tools_path)
181
+ logger.info("Successfully imported custom tools from root tools.py")
182
+ else:
183
+ logger.info("No custom tools.py file found in the root directory")
184
+ custom_tools_module = None
185
+
186
+ if custom_tools_module:
187
+ # Update the tools list with custom tools
188
+ if hasattr(custom_tools_module, 'tools') and isinstance(custom_tools_module.tools, list):
189
+ tools.extend(custom_tools_module.tools)
190
+ else:
191
+ for name, obj in custom_tools_module.__dict__.items():
192
+ if callable(obj) and not name.startswith("__"):
193
+ tools.append(({"type": "function", "function": obj}, obj))
194
+
195
+ except Exception as e:
196
+ logger.warning(f"Error importing custom tools: {str(e)}. Continuing without custom tools.")
197
+
147
198
  @cl.on_chat_start
148
199
  async def start():
149
200
  initialize_db()
@@ -365,4 +416,6 @@ async def on_chat_resume(thread: ThreadDict):
365
416
  cl.user_session.set("message_history", message_history)
366
417
 
367
418
  # Reconnect to OpenAI realtime
368
- await setup_openai_realtime()
419
+ await setup_openai_realtime()
420
+
421
+
@@ -552,6 +552,7 @@ class RealtimeClient(RealtimeEventHandler):
552
552
  for key in self.tools
553
553
  ]
554
554
  session = {**self.session_config, "tools": use_tools}
555
+ logger.debug(f"Updating session: {session}")
555
556
  if self.realtime.is_connected():
556
557
  await self.realtime.send("session.update", {"session": session})
557
558
  return True
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PraisonAI
3
- Version: 0.1.1
3
+ Version: 0.1.3
4
4
  Summary: PraisonAI application combines AutoGen and CrewAI or similar frameworks into a low-code solution for building and managing multi-agent LLM systems, focusing on simplicity, customization, and efficient human-agent collaboration.
5
5
  Author: Mervin Praison
6
6
  Requires-Python: >=3.10,<3.13
@@ -4,7 +4,7 @@ praisonai/agents_generator.py,sha256=8d1WRbubvEkBrW1HZ7_xnGyqgJi0yxmXa3MgTIqef1c
4
4
  praisonai/auto.py,sha256=9spTXqj47Hmmqv5QHRYE_RzSVHH_KoPbaZjskUj2UcE,7895
5
5
  praisonai/chainlit_ui.py,sha256=bNR7s509lp0I9JlJNvwCZRUZosC64qdvlFCt8NmFamQ,12216
6
6
  praisonai/cli.py,sha256=raZ-thG6SShb9kHjiBXMQbJWn10mBuycZxj6WDWfFa4,20105
7
- praisonai/deploy.py,sha256=3GI7JyA3rDK6QxfOpM8qFJSqAeh76R4bBnTLfRZa7Cc,6027
7
+ praisonai/deploy.py,sha256=B2DN_1AvKgE3qy8feEWsSDa1zCDk2sB_kTiJ1a2rlxc,6027
8
8
  praisonai/inbuilt_tools/__init__.py,sha256=mUKnbL6Gram9c9f2m8wJwEzURBLmPEOcHzwySBH89YA,74
9
9
  praisonai/inbuilt_tools/autogen_tools.py,sha256=svYkM2N7DVFvbiwgoAS7U_MqTOD8rHf8VD3BaFUV5_Y,14907
10
10
  praisonai/inc/__init__.py,sha256=sPDlYBBwdk0VlWzaaM_lG0_LD07lS2HRGvPdxXJFiYg,62
@@ -39,14 +39,14 @@ praisonai/ui/public/logo_dark.png,sha256=frHz1zkrnivGssJgk9iy1cabojkVgm8B4MllFwL
39
39
  praisonai/ui/public/logo_light.png,sha256=8cQRti_Ysa30O3_7C3ku2w40LnVUUlUok47H-3ZZHSU,19656
40
40
  praisonai/ui/public/movie.svg,sha256=aJ2EQ8vXZusVsF2SeuAVxP4RFJzQ14T26ejrGYdBgzk,1289
41
41
  praisonai/ui/public/thriller.svg,sha256=2dYY72EcgbEyTxS4QzjAm37Y4srtPWEW4vCMFki98ZI,3163
42
- praisonai/ui/realtime.py,sha256=MiE6-qXz_5BKLzNHK6rR2bfuhy3pgws_l53dvWfXRZU,13313
43
- praisonai/ui/realtimeclient/__init__.py,sha256=elBrv4VUKTmntwrxyhrfnBah6hUkOhMNKmK-WyPkwcQ,27460
42
+ praisonai/ui/realtime.py,sha256=qpgcGA8CIUfYuSXtQM0zSlxktFtUZXsryn0Tru-R5wU,15304
43
+ praisonai/ui/realtimeclient/__init__.py,sha256=zA2xa7rBUSw77wFkndJMQNNPqdH6ywQ3uf4WSYHjNfs,27513
44
44
  praisonai/ui/realtimeclient/realtimedocs.txt,sha256=hmgd8Uwy2SkjSndyyF_-ZOaNxiyHwGaQLGc67DvV-sI,26395
45
45
  praisonai/ui/realtimeclient/tools.py,sha256=IJOYwVOBW5Ocn5_iV9pFkmSKR3WU3YpX3kwF0I3jikQ,7855
46
46
  praisonai/ui/sql_alchemy.py,sha256=kf025P_37C505YDDJZ-dPSmN_d62J2DCrkxbDAzXyrM,29884
47
47
  praisonai/version.py,sha256=ugyuFliEqtAwQmH4sTlc16YXKYbFWDmfyk87fErB8-8,21
48
- praisonai-0.1.1.dist-info/LICENSE,sha256=kqvFysVlnFxYOu0HxCe2HlmZmJtdmNGOxWRRkT9TsWc,1035
49
- praisonai-0.1.1.dist-info/METADATA,sha256=ThER1u9GW_m5hf7j2izji2C7rSYn1ZgrEtvs4Y6sP7Y,12899
50
- praisonai-0.1.1.dist-info/WHEEL,sha256=HBsDV7Hj4OTiS1GX6ua7iQXUQTB9UHftbBxr7Q8Xm9c,110
51
- praisonai-0.1.1.dist-info/entry_points.txt,sha256=jB078LEGLY3Ky_indhclomRIVVpXrPSksHjJ-tcBZ-o,133
52
- praisonai-0.1.1.dist-info/RECORD,,
48
+ praisonai-0.1.3.dist-info/LICENSE,sha256=kqvFysVlnFxYOu0HxCe2HlmZmJtdmNGOxWRRkT9TsWc,1035
49
+ praisonai-0.1.3.dist-info/METADATA,sha256=boFS2u0Nw_N9dnAkFsRhBEkE5tKZOyt8a3Wkd-3aJT8,12899
50
+ praisonai-0.1.3.dist-info/WHEEL,sha256=HBsDV7Hj4OTiS1GX6ua7iQXUQTB9UHftbBxr7Q8Xm9c,110
51
+ praisonai-0.1.3.dist-info/entry_points.txt,sha256=jB078LEGLY3Ky_indhclomRIVVpXrPSksHjJ-tcBZ-o,133
52
+ praisonai-0.1.3.dist-info/RECORD,,