PraisonAI 1.0.11__cp312-cp312-manylinux_2_39_x86_64.whl → 2.0.1__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.

@@ -20,6 +20,13 @@ CREWAI_AVAILABLE = False
20
20
  AUTOGEN_AVAILABLE = False
21
21
  PRAISONAI_TOOLS_AVAILABLE = False
22
22
  AGENTOPS_AVAILABLE = False
23
+ PRAISONAI_AVAILABLE = False
24
+
25
+ try:
26
+ from praisonaiagents import Agent as PraisonAgent, Task as PraisonTask, PraisonAIAgents
27
+ PRAISONAI_AVAILABLE = True
28
+ except ImportError:
29
+ pass
23
30
 
24
31
  try:
25
32
  from crewai import Agent, Task, Crew
@@ -37,11 +44,14 @@ except ImportError:
37
44
  try:
38
45
  import agentops
39
46
  AGENTOPS_AVAILABLE = True
47
+ AGENTOPS_API_KEY = os.getenv("AGENTOPS_API_KEY")
48
+ if not AGENTOPS_API_KEY:
49
+ AGENTOPS_AVAILABLE = False
40
50
  except ImportError:
41
51
  pass
42
52
 
43
53
  # Only try to import praisonai_tools if either CrewAI or AutoGen is available
44
- if CREWAI_AVAILABLE or AUTOGEN_AVAILABLE:
54
+ if CREWAI_AVAILABLE or AUTOGEN_AVAILABLE or PRAISONAI_AVAILABLE:
45
55
  try:
46
56
  from praisonai_tools import (
47
57
  CodeDocsSearchTool, CSVSearchTool, DirectorySearchTool, DOCXSearchTool, DirectoryReadTool,
@@ -115,6 +125,8 @@ class AgentsGenerator:
115
125
  raise ImportError("CrewAI is not installed. Please install it with 'pip install praisonai[crewai]'")
116
126
  elif framework == "autogen" and not AUTOGEN_AVAILABLE:
117
127
  raise ImportError("AutoGen is not installed. Please install it with 'pip install praisonai[autogen]'")
128
+ elif framework == "praisonai" and not PRAISONAI_AVAILABLE:
129
+ raise ImportError("PraisonAI is not installed. Please install it with 'pip install praisonaiagents'")
118
130
 
119
131
  def is_function_or_decorated(self, obj):
120
132
  """
@@ -221,7 +233,7 @@ class AgentsGenerator:
221
233
  tools_dict = {}
222
234
 
223
235
  # Only try to use praisonai_tools if it's available and needed
224
- if PRAISONAI_TOOLS_AVAILABLE and (CREWAI_AVAILABLE or AUTOGEN_AVAILABLE):
236
+ if PRAISONAI_TOOLS_AVAILABLE and (CREWAI_AVAILABLE or AUTOGEN_AVAILABLE or PRAISONAI_AVAILABLE):
225
237
  tools_dict = {
226
238
  'CodeDocsSearchTool': CodeDocsSearchTool(),
227
239
  'CSVSearchTool': CSVSearchTool(),
@@ -266,13 +278,19 @@ class AgentsGenerator:
266
278
  if not AUTOGEN_AVAILABLE:
267
279
  raise ImportError("AutoGen is not installed. Please install it with 'pip install praisonai[autogen]'")
268
280
  if AGENTOPS_AVAILABLE:
269
- agentops.init(os.environ.get("AGENTOPS_API_KEY"), tags=["autogen"])
281
+ agentops.init(os.environ.get("AGENTOPS_API_KEY"), default_tags=["autogen"])
270
282
  return self._run_autogen(config, topic, tools_dict)
283
+ elif framework == "praisonai":
284
+ if not PRAISONAI_AVAILABLE:
285
+ raise ImportError("PraisonAI is not installed. Please install it with 'pip install praisonaiagents'")
286
+ if AGENTOPS_AVAILABLE:
287
+ agentops.init(os.environ.get("AGENTOPS_API_KEY"), default_tags=["praisonai"])
288
+ return self._run_praisonai(config, topic, tools_dict)
271
289
  else: # framework=crewai
272
290
  if not CREWAI_AVAILABLE:
273
291
  raise ImportError("CrewAI is not installed. Please install it with 'pip install praisonai[crewai]'")
274
292
  if AGENTOPS_AVAILABLE:
275
- agentops.init(os.environ.get("AGENTOPS_API_KEY"), tags=["crewai"])
293
+ agentops.init(os.environ.get("AGENTOPS_API_KEY"), default_tags=["crewai"])
276
294
  return self._run_crewai(config, topic, tools_dict)
277
295
 
278
296
  def _run_autogen(self, config, topic, tools_dict):
@@ -472,3 +490,126 @@ class AgentsGenerator:
472
490
 
473
491
  return result
474
492
 
493
+ def _run_praisonai(self, config, topic, tools_dict):
494
+ """
495
+ Run agents using the PraisonAI framework.
496
+ """
497
+ agents = {}
498
+ tasks = []
499
+ tasks_dict = {}
500
+
501
+ # Create agents from config
502
+ for role, details in config['roles'].items():
503
+ role_filled = details['role'].format(topic=topic)
504
+ goal_filled = details['goal'].format(topic=topic)
505
+ backstory_filled = details['backstory'].format(topic=topic)
506
+
507
+ # Get agent tools
508
+ agent_tools = [tools_dict[tool] for tool in details.get('tools', [])
509
+ if tool in tools_dict]
510
+
511
+ # Configure LLM
512
+ llm_model = details.get('llm')
513
+ if llm_model:
514
+ llm = llm_model.get("model", os.environ.get("MODEL_NAME", "gpt-4o"))
515
+ else:
516
+ llm = os.environ.get("MODEL_NAME", "gpt-4o")
517
+
518
+ # Configure function calling LLM
519
+ function_calling_llm_model = details.get('function_calling_llm')
520
+ if function_calling_llm_model:
521
+ function_calling_llm = function_calling_llm_model.get("model", os.environ.get("MODEL_NAME", "openai/gpt-4o"))
522
+ else:
523
+ function_calling_llm = os.environ.get("MODEL_NAME", "gpt-4o")
524
+
525
+ # Create PraisonAI agent
526
+ agent = PraisonAgent(
527
+ name=role_filled,
528
+ role=role_filled,
529
+ goal=goal_filled,
530
+ backstory=backstory_filled,
531
+ tools=agent_tools,
532
+ allow_delegation=details.get('allow_delegation', False),
533
+ llm=llm,
534
+ function_calling_llm=function_calling_llm,
535
+ max_iter=details.get('max_iter', 15),
536
+ max_rpm=details.get('max_rpm'),
537
+ max_execution_time=details.get('max_execution_time'),
538
+ verbose=details.get('verbose', True),
539
+ cache=details.get('cache', True),
540
+ system_template=details.get('system_template'),
541
+ prompt_template=details.get('prompt_template'),
542
+ response_template=details.get('response_template'),
543
+ )
544
+
545
+ # Set agent callback if provided
546
+ if self.agent_callback:
547
+ agent.step_callback = self.agent_callback
548
+
549
+ agents[role] = agent
550
+
551
+ # Create tasks for the agent
552
+ for task_name, task_details in details.get('tasks', {}).items():
553
+ description_filled = task_details['description'].format(topic=topic)
554
+ expected_output_filled = task_details['expected_output'].format(topic=topic)
555
+
556
+ # Create task using PraisonAI Task class
557
+ task = PraisonTask(
558
+ description=description_filled,
559
+ expected_output=expected_output_filled,
560
+ agent=agent,
561
+ tools=task_details.get('tools', []),
562
+ async_execution=task_details.get('async_execution', False),
563
+ context=[],
564
+ config=task_details.get('config', {}),
565
+ output_json=task_details.get('output_json'),
566
+ output_pydantic=task_details.get('output_pydantic'),
567
+ output_file=task_details.get('output_file', ""),
568
+ callback=task_details.get('callback'),
569
+ create_directory=task_details.get('create_directory', False)
570
+ )
571
+
572
+ # Set task callback if provided
573
+ if self.task_callback:
574
+ task.callback = self.task_callback
575
+
576
+ tasks.append(task)
577
+ tasks_dict[task_name] = task
578
+
579
+ # Set up task contexts
580
+ for role, details in config['roles'].items():
581
+ for task_name, task_details in details.get('tasks', {}).items():
582
+ task = tasks_dict[task_name]
583
+ context_tasks = [tasks_dict[ctx] for ctx in task_details.get('context', [])
584
+ if ctx in tasks_dict]
585
+ task.context = context_tasks
586
+
587
+ # Create and run the PraisonAI agents
588
+ if config.get('process') == 'hierarchical':
589
+ agents = PraisonAIAgents(
590
+ agents=list(agents.values()),
591
+ tasks=tasks,
592
+ verbose=True,
593
+ process="hierarchical",
594
+ manager_llm=config.get('manager_llm', 'gpt-4o'),
595
+ )
596
+ else:
597
+ agents = PraisonAIAgents(
598
+ agents=list(agents.values()),
599
+ tasks=tasks,
600
+ verbose=2
601
+ )
602
+
603
+ self.logger.debug("Final Configuration:")
604
+ self.logger.debug(f"Agents: {agents.agents}")
605
+ self.logger.debug(f"Tasks: {agents.tasks}")
606
+
607
+ response = agents.start()
608
+ # result = f"### Task Output ###\n{response}"
609
+ self.logger.debug(f"Result: {response}")
610
+ result = ""
611
+
612
+ if AGENTOPS_AVAILABLE:
613
+ agentops.end_session("Success")
614
+
615
+ return result
praisonai/auto.py CHANGED
@@ -12,6 +12,13 @@ import logging
12
12
  CREWAI_AVAILABLE = False
13
13
  AUTOGEN_AVAILABLE = False
14
14
  PRAISONAI_TOOLS_AVAILABLE = False
15
+ PRAISONAI_AVAILABLE = False
16
+
17
+ try:
18
+ from praisonaiagents import Agent as PraisonAgent, Task as PraisonTask, PraisonAIAgents
19
+ PRAISONAI_AVAILABLE = True
20
+ except ImportError:
21
+ pass
15
22
 
16
23
  try:
17
24
  from crewai import Agent, Task, Crew
@@ -71,6 +78,11 @@ CrewAI is not installed. Please install with:
71
78
  AutoGen is not installed. Please install with:
72
79
  pip install "praisonai[autogen]"
73
80
  """)
81
+ elif framework == "praisonai" and not PRAISONAI_AVAILABLE:
82
+ raise ImportError("""
83
+ Praisonai is not installed. Please install with:
84
+ pip install praisonaiagents
85
+ """)
74
86
 
75
87
  # Only show tools message if using a framework and tools are needed
76
88
  if (framework in ["crewai", "autogen"]) and not PRAISONAI_TOOLS_AVAILABLE:
@@ -88,7 +100,7 @@ Tools are not available for {framework}. To use tools, install:
88
100
  ]
89
101
  self.topic = topic
90
102
  self.agent_file = agent_file
91
- self.framework = framework or "crewai"
103
+ self.framework = framework or "praisonai"
92
104
  self.client = instructor.patch(
93
105
  OpenAI(
94
106
  base_url=self.config_list[0]['base_url'],
praisonai/cli.py CHANGED
@@ -24,6 +24,7 @@ GRADIO_AVAILABLE = False
24
24
  CALL_MODULE_AVAILABLE = False
25
25
  CREWAI_AVAILABLE = False
26
26
  AUTOGEN_AVAILABLE = False
27
+ PRAISONAI_AVAILABLE = False
27
28
 
28
29
  try:
29
30
  # Create necessary directories and set CHAINLIT_APP_ROOT
@@ -65,6 +66,12 @@ try:
65
66
  except ImportError:
66
67
  pass
67
68
 
69
+ try:
70
+ from praisonaiagents import Agent as PraisonAgent, Task as PraisonTask, PraisonAIAgents
71
+ PRAISONAI_AVAILABLE = True
72
+ except ImportError:
73
+ pass
74
+
68
75
  logging.basicConfig(level=os.environ.get('LOGLEVEL', 'INFO'), format='%(asctime)s - %(levelname)s - %(message)s')
69
76
 
70
77
  def stream_subprocess(command, env=None):
@@ -273,7 +280,7 @@ class PraisonAI:
273
280
  Parse the command-line arguments for the PraisonAI CLI.
274
281
  """
275
282
  parser = argparse.ArgumentParser(prog="praisonai", description="praisonAI command-line interface")
276
- parser.add_argument("--framework", choices=["crewai", "autogen"], help="Specify the framework")
283
+ parser.add_argument("--framework", choices=["crewai", "autogen", "praisonai"], help="Specify the framework")
277
284
  parser.add_argument("--ui", choices=["chainlit", "gradio"], help="Specify the UI framework (gradio or chainlit).")
278
285
  parser.add_argument("--auto", nargs=argparse.REMAINDER, help="Enable auto mode and pass arguments for it")
279
286
  parser.add_argument("--init", nargs=argparse.REMAINDER, help="Initialize agents with optional topic")
@@ -381,11 +388,12 @@ class PraisonAI:
381
388
 
382
389
  # Only check framework availability for agent-related operations
383
390
  if not args.command and (args.init or args.auto or args.framework):
384
- if not CREWAI_AVAILABLE and not AUTOGEN_AVAILABLE:
391
+ if not CREWAI_AVAILABLE and not AUTOGEN_AVAILABLE and not PRAISONAI_AVAILABLE:
385
392
  print("[red]ERROR: No framework is installed. Please install at least one framework:[/red]")
386
393
  print("\npip install \"praisonai\\[crewai]\" # For CrewAI")
387
394
  print("pip install \"praisonai\\[autogen]\" # For AutoGen")
388
395
  print("pip install \"praisonai\\[crewai,autogen]\" # For both frameworks\n")
396
+ print("pip install praisonaiagents # For PraisonAIAgents\n")
389
397
  sys.exit(1)
390
398
 
391
399
  return args
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==1.0.11 gunicorn markdown\n")
59
+ file.write("RUN pip install flask praisonai==2.0.1 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
 
@@ -69,7 +69,7 @@ cot = "full"
69
69
 
70
70
  # Specify a CSS file that can be used to customize the user interface.
71
71
  # The CSS file can be served from the public directory or via an external link.
72
- custom_css = "https://cdn.jsdelivr.net/gh/MervinPraison/PraisonAI@1.0.11/praisonai/ui/public/praison.css"
72
+ custom_css = "https://cdn.jsdelivr.net/gh/MervinPraison/PraisonAI@2.0.1/praisonai/ui/public/praison.css"
73
73
 
74
74
  # Specify a Javascript file that can be used to customize the user interface.
75
75
  # The Javascript file can be served from the public directory.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PraisonAI
3
- Version: 1.0.11
3
+ Version: 2.0.1
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
@@ -23,9 +23,10 @@ Provides-Extra: openai
23
23
  Provides-Extra: realtime
24
24
  Provides-Extra: train
25
25
  Provides-Extra: ui
26
+ Requires-Dist: PyYAML (>=6.0)
26
27
  Requires-Dist: agentops (>=0.3.12) ; extra == "agentops"
27
28
  Requires-Dist: aiosqlite (>=0.20.0) ; extra == "chat" or extra == "code" or extra == "realtime"
28
- Requires-Dist: chainlit (==1.3.0rc1) ; extra == "ui" or extra == "chat" or extra == "code" or extra == "realtime"
29
+ Requires-Dist: chainlit (==2.0rc1) ; extra == "ui" or extra == "chat" or extra == "code" or extra == "realtime"
29
30
  Requires-Dist: crawl4ai (==0.3.4) ; extra == "chat" or extra == "code" or extra == "realtime"
30
31
  Requires-Dist: crewai (>=0.32.0) ; extra == "crewai" or extra == "autogen"
31
32
  Requires-Dist: duckduckgo_search (>=6.3.0) ; extra == "realtime"
@@ -45,11 +46,12 @@ Requires-Dist: openai (>=1.54.0) ; extra == "call"
45
46
  Requires-Dist: playwright (>=1.47.0) ; extra == "chat" or extra == "code"
46
47
  Requires-Dist: plotly (>=5.24.0) ; extra == "realtime"
47
48
  Requires-Dist: praisonai-tools (>=0.0.7) ; extra == "crewai" or extra == "autogen"
49
+ Requires-Dist: praisonaiagents (>=0.0.4)
48
50
  Requires-Dist: pyautogen (>=0.2.19) ; extra == "autogen"
49
51
  Requires-Dist: pydantic (<=2.10.1) ; extra == "chat" or extra == "code"
50
52
  Requires-Dist: pyngrok (>=1.4.0) ; extra == "call"
51
53
  Requires-Dist: pyparsing (>=3.0.0)
52
- Requires-Dist: python-dotenv (>=0.19.0) ; extra == "call"
54
+ Requires-Dist: python-dotenv (>=1.0.1) ; extra == "call"
53
55
  Requires-Dist: rich (>=13.7) ; extra == "chat" or extra == "call"
54
56
  Requires-Dist: sqlalchemy (>=2.0.36) ; extra == "chat" or extra == "code" or extra == "realtime"
55
57
  Requires-Dist: tavily-python (==0.5.0) ; extra == "chat" or extra == "code" or extra == "realtime"
@@ -1,11 +1,11 @@
1
1
  praisonai/__init__.py,sha256=JrgyPlzZfLlozoW7SHZ1nVJ63rLPR3ki2k5ZPywYrnI,175
2
2
  praisonai/__main__.py,sha256=MVgsjMThjBexHt4nhd760JCqvP4x0IQcwo8kULOK4FQ,144
3
- praisonai/agents_generator.py,sha256=CYqoJj4wHi_2lD39vAiOiLLV7SYg30o5nky09u5ViAE,20801
3
+ praisonai/agents_generator.py,sha256=9-KuU1--_cBI85y2J-9XjW0LYHTCMnKJhy5WAUrf3M0,26887
4
4
  praisonai/api/call.py,sha256=iHdAlgIH_oTsEbjaGGu1Jjo6DTfMR-SfFdtSxnOLCeY,11032
5
- praisonai/auto.py,sha256=NDQiTV8ex_NE5C6AoY26-gMyLZNYrfthgQ6G0Dn1uhU,8304
5
+ praisonai/auto.py,sha256=uLDm8CU3L_3amZsd55yzf9RdBF1uW-BGSx7nl9ctNZ4,8680
6
6
  praisonai/chainlit_ui.py,sha256=bNR7s509lp0I9JlJNvwCZRUZosC64qdvlFCt8NmFamQ,12216
7
- praisonai/cli.py,sha256=JAopax31bOyHi0uHqucq-Jt-uAASTXAKfs0if7mlvZ0,20903
8
- praisonai/deploy.py,sha256=BYncPlo774jSJTqIYoPAreP0dsBodOeSBlIpfd3IvZc,6028
7
+ praisonai/cli.py,sha256=O7abKND2MP_yDdD_OclPoiZG1JRoGc4u9KowbRzuQuQ,21209
8
+ praisonai/deploy.py,sha256=NxKvfC53zDznMaMePYkaJR0h1sYkDgMXv3LYxLVs1jI,6027
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
@@ -36,7 +36,7 @@ praisonai/ui/README.md,sha256=QG9yucvBieVjCjWFzu6hL9xNtYllkoqyJ_q1b0YYAco,1124
36
36
  praisonai/ui/chat.py,sha256=rlYwhTd3giBuvtK4Yc9kf6N9jfVT0VrZ-mLIzhANGiQ,13565
37
37
  praisonai/ui/code.py,sha256=GD_xQTo7qzpOM98tu4MOPsviJdXU__Ta3JIfsjoRe6U,15797
38
38
  praisonai/ui/components/aicoder.py,sha256=Xh95RSEJCel5mEGic4vdtzyNpHNULF3ymft9nbwglXY,11155
39
- praisonai/ui/config/.chainlit/config.toml,sha256=a61MjfHZDGt0xGs9mOC21LHJZHY95Acxo5uvP0hJkvU,3825
39
+ praisonai/ui/config/.chainlit/config.toml,sha256=nTpaTDrCK4UxCYqbBcwxHl8K5phqu8Akt0SoDC4stkA,3824
40
40
  praisonai/ui/config/.chainlit/translations/bn.json,sha256=m2TAaGMS-18_siW5dw4sbosh0Wn8ENWWzdGYkHaBrXw,22679
41
41
  praisonai/ui/config/.chainlit/translations/en-US.json,sha256=QoQAg8P5Q5gbGASc-HAHcfhufk71-Uc1u_ewIBfHuLc,9821
42
42
  praisonai/ui/config/.chainlit/translations/gu.json,sha256=9wE-NsHf7j5VUFzfE-cCpESTyHtzVHRcZXAwC3ACMl0,21660
@@ -75,8 +75,8 @@ praisonai/ui/realtimeclient/realtimedocs.txt,sha256=hmgd8Uwy2SkjSndyyF_-ZOaNxiyH
75
75
  praisonai/ui/realtimeclient/tools.py,sha256=IJOYwVOBW5Ocn5_iV9pFkmSKR3WU3YpX3kwF0I3jikQ,7855
76
76
  praisonai/ui/sql_alchemy.py,sha256=cfyL9uFfuizKFvW0aZfUBlJWPQYI-YBi1v4vxlkb1BQ,29615
77
77
  praisonai/version.py,sha256=ugyuFliEqtAwQmH4sTlc16YXKYbFWDmfyk87fErB8-8,21
78
- praisonai-1.0.11.dist-info/LICENSE,sha256=kqvFysVlnFxYOu0HxCe2HlmZmJtdmNGOxWRRkT9TsWc,1035
79
- praisonai-1.0.11.dist-info/METADATA,sha256=G970R4iJK7lrtMtd3TWM1efEMxznfd5fQju2c1-GjBY,17375
80
- praisonai-1.0.11.dist-info/WHEEL,sha256=x1HiyTP_r-PIOu3STHzjukjf5kVLXzgVftSXf5bl8AU,110
81
- praisonai-1.0.11.dist-info/entry_points.txt,sha256=I_xc6a6MNTTfLxYmAxe0rgey0G-_hbY07oFW-ZDnkw4,135
82
- praisonai-1.0.11.dist-info/RECORD,,
78
+ praisonai-2.0.1.dist-info/LICENSE,sha256=kqvFysVlnFxYOu0HxCe2HlmZmJtdmNGOxWRRkT9TsWc,1035
79
+ praisonai-2.0.1.dist-info/METADATA,sha256=3qoIcd7N8JBf2EHutRil4IADlBlnK7GlADzZGrITvqw,17442
80
+ praisonai-2.0.1.dist-info/WHEEL,sha256=x1HiyTP_r-PIOu3STHzjukjf5kVLXzgVftSXf5bl8AU,110
81
+ praisonai-2.0.1.dist-info/entry_points.txt,sha256=I_xc6a6MNTTfLxYmAxe0rgey0G-_hbY07oFW-ZDnkw4,135
82
+ praisonai-2.0.1.dist-info/RECORD,,