PraisonAI 0.0.71__cp312-cp312-manylinux_2_35_x86_64.whl → 0.0.72__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.0.71 gunicorn markdown\n")
59
+ file.write("RUN pip install flask praisonai==0.0.72 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/chat.py CHANGED
@@ -15,6 +15,8 @@ import logging
15
15
  import json
16
16
  from sql_alchemy import SQLAlchemyDataLayer
17
17
  from tavily import TavilyClient
18
+ from crawl4ai import WebCrawler
19
+ import asyncio
18
20
 
19
21
  # Set up logging
20
22
  logger = logging.getLogger(__name__)
@@ -176,27 +178,55 @@ cl_data._data_layer = SQLAlchemyDataLayer(conninfo=f"sqlite+aiosqlite:///{DB_PAT
176
178
  tavily_api_key = os.getenv("TAVILY_API_KEY")
177
179
  tavily_client = TavilyClient(api_key=tavily_api_key) if tavily_api_key else None
178
180
 
179
- # Function to call Tavily Search API
181
+ # Modify the tavily_web_search function to be synchronous
180
182
  def tavily_web_search(query):
181
183
  if not tavily_client:
182
184
  return json.dumps({
183
185
  "query": query,
184
186
  "error": "Tavily API key is not set. Web search is unavailable."
185
187
  })
188
+
186
189
  response = tavily_client.search(query)
187
- print(response) # Print the full response
190
+ logger.debug(f"Tavily search response: {response}")
191
+
192
+ # Create an instance of WebCrawler
193
+ crawler = WebCrawler()
194
+
195
+ # Warm up the crawler (load necessary models)
196
+ crawler.warmup()
197
+
198
+ # Prepare the results
199
+ results = []
200
+ for result in response.get('results', []):
201
+ url = result.get('url')
202
+ if url:
203
+ try:
204
+ # Run the crawler on each URL
205
+ crawl_result = crawler.run(url=url)
206
+ results.append({
207
+ "content": result.get('content'),
208
+ "url": url,
209
+ "full_content": crawl_result.markdown
210
+ })
211
+ except Exception as e:
212
+ logger.error(f"Error crawling {url}: {str(e)}")
213
+ results.append({
214
+ "content": result.get('content'),
215
+ "url": url,
216
+ "full_content": "Error: Unable to crawl this URL"
217
+ })
218
+
188
219
  return json.dumps({
189
220
  "query": query,
190
- "answer": response.get('answer'),
191
- "top_result": response['results'][0]['content'] if response['results'] else 'No results found'
221
+ "results": results
192
222
  })
193
223
 
194
- # Define the tool for function calling
224
+ # Update the tools definition
195
225
  tools = [{
196
226
  "type": "function",
197
227
  "function": {
198
228
  "name": "tavily_web_search",
199
- "description": "Search the web using Tavily API",
229
+ "description": "Search the web using Tavily API and crawl the resulting URLs",
200
230
  "parameters": {
201
231
  "type": "object",
202
232
  "properties": {
@@ -346,6 +376,7 @@ Current Date and Time: {now}
346
376
  if function_args:
347
377
  try:
348
378
  function_args = json.loads(function_args)
379
+ # Call the function synchronously
349
380
  function_response = function_to_call(
350
381
  query=function_args.get("query"),
351
382
  )
praisonai/ui/code.py CHANGED
@@ -17,6 +17,8 @@ from sql_alchemy import SQLAlchemyDataLayer
17
17
  from context import ContextGatherer
18
18
  from tavily import TavilyClient
19
19
  from datetime import datetime
20
+ from crawl4ai import WebCrawler
21
+
20
22
  # Set up logging
21
23
  logger = logging.getLogger(__name__)
22
24
  log_level = os.getenv("LOGLEVEL", "INFO").upper()
@@ -238,19 +240,47 @@ async def setup_agent(settings):
238
240
  tavily_api_key = os.getenv("TAVILY_API_KEY")
239
241
  tavily_client = TavilyClient(api_key=tavily_api_key) if tavily_api_key else None
240
242
 
241
- # Function to call Tavily Search API
243
+ # Function to call Tavily Search API and crawl the results
242
244
  def tavily_web_search(query):
243
245
  if not tavily_client:
244
246
  return json.dumps({
245
247
  "query": query,
246
248
  "error": "Tavily API key is not set. Web search is unavailable."
247
249
  })
250
+
248
251
  response = tavily_client.search(query)
249
- print(response) # Print the full response
252
+ logger.debug(f"Tavily search response: {response}")
253
+
254
+ # Create an instance of WebCrawler
255
+ crawler = WebCrawler()
256
+
257
+ # Warm up the crawler (load necessary models)
258
+ crawler.warmup()
259
+
260
+ # Prepare the results
261
+ results = []
262
+ for result in response.get('results', []):
263
+ url = result.get('url')
264
+ if url:
265
+ try:
266
+ # Run the crawler on each URL
267
+ crawl_result = crawler.run(url=url)
268
+ results.append({
269
+ "content": result.get('content'),
270
+ "url": url,
271
+ "full_content": crawl_result.markdown
272
+ })
273
+ except Exception as e:
274
+ logger.error(f"Error crawling {url}: {str(e)}")
275
+ results.append({
276
+ "content": result.get('content'),
277
+ "url": url,
278
+ "full_content": "Error: Unable to crawl this URL"
279
+ })
280
+
250
281
  return json.dumps({
251
282
  "query": query,
252
- "answer": response.get('answer'),
253
- "top_result": response['results'][0]['content'] if response['results'] else 'No results found'
283
+ "results": results
254
284
  })
255
285
 
256
286
  # Define the tool for function calling
@@ -258,7 +288,7 @@ tools = [{
258
288
  "type": "function",
259
289
  "function": {
260
290
  "name": "tavily_web_search",
261
- "description": "Search the web using Tavily API",
291
+ "description": "Search the web using Tavily API and crawl the resulting URLs",
262
292
  "parameters": {
263
293
  "type": "object",
264
294
  "properties": {
@@ -300,14 +330,14 @@ async def main(message: cl.Message):
300
330
  completion_params["tool_choice"] = "auto"
301
331
 
302
332
  response = await acompletion(**completion_params)
303
- print(response)
333
+ logger.debug(f"LLM response: {response}")
304
334
 
305
335
  full_response = ""
306
336
  tool_calls = []
307
337
  current_tool_call = None
308
338
 
309
339
  async for part in response:
310
- print(part)
340
+ logger.debug(f"LLM part: {part}")
311
341
  if 'choices' in part and len(part['choices']) > 0:
312
342
  delta = part['choices'][0].get('delta', {})
313
343
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PraisonAI
3
- Version: 0.0.71
3
+ Version: 0.0.72
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
@@ -19,9 +19,10 @@ Provides-Extra: gradio
19
19
  Provides-Extra: openai
20
20
  Provides-Extra: train
21
21
  Provides-Extra: ui
22
- Requires-Dist: agentops (>=0.2.6) ; extra == "agentops"
22
+ Requires-Dist: agentops (>=0.3.12) ; extra == "agentops"
23
23
  Requires-Dist: aiosqlite (>=0.20.0) ; extra == "chat" or extra == "code"
24
24
  Requires-Dist: chainlit (==1.2.0) ; extra == "ui" or extra == "chat" or extra == "code"
25
+ Requires-Dist: crawl4ai (==0.3.4) ; extra == "chat" or extra == "code"
25
26
  Requires-Dist: crewai (>=0.32.0)
26
27
  Requires-Dist: flask (>=3.0.0) ; extra == "api"
27
28
  Requires-Dist: gradio (>=4.26.0) ; extra == "gradio"
@@ -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=M23MbUUzNS7z9ZHz3cGawUrGWzXM-FzhMyiRWQPZSEk,18485
7
- praisonai/deploy.py,sha256=mqUqKDDG1wYv6KMkjFtFvVztF1PTxkg1tCqxxlQbL1w,6028
7
+ praisonai/deploy.py,sha256=7F24Wlty3Rs4tn5He1Rw1i24B6dR5E0SIJyLEPaCPX8,6028
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
@@ -30,8 +30,8 @@ praisonai/setup/setup_conda_env.py,sha256=4QiWrqgEObivzOMwfJgWaCPpUEpB68cQ6lFwVw
30
30
  praisonai/setup/setup_conda_env.sh,sha256=te7s0KHsTi7XM-vkNvE0dKC1HeU2tXxqE-sPUScV6fY,2718
31
31
  praisonai/test.py,sha256=OL-wesjA5JTohr8rtr6kWoaS4ImkJg2l0GXJ-dUUfRU,4090
32
32
  praisonai/train.py,sha256=DvORlrwKOD-2v4r_z84eV3LsfzpNs-WnPKb5cQB3_t4,11071
33
- praisonai/ui/chat.py,sha256=1isfD8j47rfqNrTfcUQ8rWH3MqX2OsfRSzZRu7uC-h8,15305
34
- praisonai/ui/code.py,sha256=wtlziGIJBDHrpH_0VZhtejN5K5_Yr0tcKaoajvcv7RQ,16231
33
+ praisonai/ui/chat.py,sha256=89wW2WcYpixokGDOdfdW76zb-hJSu61xv73hrd1JqJY,16244
34
+ praisonai/ui/code.py,sha256=YC94_BGNqM6ldiERnGTnmLaedbajeUqTbaTYIk4Df3o,17156
35
35
  praisonai/ui/context.py,sha256=oWO2I_WBZb7kZnuXItf18EJX0ZQv-1nAd8rxhwhuuDU,11871
36
36
  praisonai/ui/public/fantasy.svg,sha256=4Gs3kIOux-pjGtw6ogI_rv5_viVJxnE5gRwGilsSg0o,1553
37
37
  praisonai/ui/public/game.svg,sha256=y2QMaA01m8XzuDjTOBWzupOC3-TpnUl9ah89mIhviUw,2406
@@ -41,8 +41,8 @@ praisonai/ui/public/movie.svg,sha256=aJ2EQ8vXZusVsF2SeuAVxP4RFJzQ14T26ejrGYdBgzk
41
41
  praisonai/ui/public/thriller.svg,sha256=2dYY72EcgbEyTxS4QzjAm37Y4srtPWEW4vCMFki98ZI,3163
42
42
  praisonai/ui/sql_alchemy.py,sha256=kf025P_37C505YDDJZ-dPSmN_d62J2DCrkxbDAzXyrM,29884
43
43
  praisonai/version.py,sha256=ugyuFliEqtAwQmH4sTlc16YXKYbFWDmfyk87fErB8-8,21
44
- praisonai-0.0.71.dist-info/LICENSE,sha256=kqvFysVlnFxYOu0HxCe2HlmZmJtdmNGOxWRRkT9TsWc,1035
45
- praisonai-0.0.71.dist-info/METADATA,sha256=gdrxsufd4HKygMtgjdDRx3Olg7ktaENlfVgf9hvN8PQ,11473
46
- praisonai-0.0.71.dist-info/WHEEL,sha256=HBsDV7Hj4OTiS1GX6ua7iQXUQTB9UHftbBxr7Q8Xm9c,110
47
- praisonai-0.0.71.dist-info/entry_points.txt,sha256=jB078LEGLY3Ky_indhclomRIVVpXrPSksHjJ-tcBZ-o,133
48
- praisonai-0.0.71.dist-info/RECORD,,
44
+ praisonai-0.0.72.dist-info/LICENSE,sha256=kqvFysVlnFxYOu0HxCe2HlmZmJtdmNGOxWRRkT9TsWc,1035
45
+ praisonai-0.0.72.dist-info/METADATA,sha256=EwHoCnCTGI3osmoSQYl5snX1h7iYoG6l8t3LWIvzW9Q,11545
46
+ praisonai-0.0.72.dist-info/WHEEL,sha256=HBsDV7Hj4OTiS1GX6ua7iQXUQTB9UHftbBxr7Q8Xm9c,110
47
+ praisonai-0.0.72.dist-info/entry_points.txt,sha256=jB078LEGLY3Ky_indhclomRIVVpXrPSksHjJ-tcBZ-o,133
48
+ praisonai-0.0.72.dist-info/RECORD,,