PraisonAI 0.0.1__py3-none-any.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/__init__.py +1 -0
- praisonAI/__main__.py +4 -0
- praisonAI/cli.py +114 -0
- praisonAI/test.py +93 -0
- praisonAI/version.py +1 -0
- praisonAI-0.0.1.dist-info/METADATA +22 -0
- praisonAI-0.0.1.dist-info/RECORD +9 -0
- praisonAI-0.0.1.dist-info/WHEEL +5 -0
- praisonAI-0.0.1.dist-info/top_level.txt +1 -0
praisonAI/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .version import __version__
|
praisonAI/__main__.py
ADDED
praisonAI/cli.py
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
from .version import __version__
|
|
3
|
+
import yaml, os
|
|
4
|
+
from rich import print
|
|
5
|
+
from dotenv import load_dotenv
|
|
6
|
+
from crewai import Agent, Task, Crew
|
|
7
|
+
load_dotenv()
|
|
8
|
+
import autogen
|
|
9
|
+
config_list = [
|
|
10
|
+
{
|
|
11
|
+
'model': os.environ.get("OPENAI_MODEL_NAME", "gpt-3.5-turbo"),
|
|
12
|
+
'base_url': os.environ.get("OPENAI_API_BASE", "https://api.openai.com/v1"),
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
def generate_crew_and_kickoff(agent_file, framework=None):
|
|
17
|
+
with open(agent_file, 'r') as f:
|
|
18
|
+
config = yaml.safe_load(f)
|
|
19
|
+
|
|
20
|
+
topic = config['topic']
|
|
21
|
+
framework = framework or config.get('framework')
|
|
22
|
+
|
|
23
|
+
agents = {}
|
|
24
|
+
tasks = []
|
|
25
|
+
if framework == "autogen":
|
|
26
|
+
# Load the LLM configuration dynamically
|
|
27
|
+
print(config_list)
|
|
28
|
+
llm_config = {"config_list": config_list}
|
|
29
|
+
|
|
30
|
+
for role, details in config['roles'].items():
|
|
31
|
+
agent_name = details['role'].format(topic=topic).replace("{topic}", topic)
|
|
32
|
+
agent_goal = details['goal'].format(topic=topic)
|
|
33
|
+
# Creating an AssistantAgent for each role dynamically
|
|
34
|
+
agents[role] = autogen.AssistantAgent(
|
|
35
|
+
name=agent_name,
|
|
36
|
+
llm_config=llm_config,
|
|
37
|
+
system_message=details['backstory'].format(topic=topic)+". Reply \"TERMINATE\" in the end when everything is done.",
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
# Preparing tasks for initiate_chats
|
|
41
|
+
for task_name, task_details in details.get('tasks', {}).items():
|
|
42
|
+
description_filled = task_details['description'].format(topic=topic)
|
|
43
|
+
expected_output_filled = task_details['expected_output'].format(topic=topic)
|
|
44
|
+
|
|
45
|
+
chat_task = {
|
|
46
|
+
"recipient": agents[role],
|
|
47
|
+
"message": description_filled,
|
|
48
|
+
"summary_method": "last_msg", # Customize as needed
|
|
49
|
+
# Additional fields like carryover can be added based on dependencies
|
|
50
|
+
}
|
|
51
|
+
tasks.append(chat_task)
|
|
52
|
+
|
|
53
|
+
# Assuming the user proxy agent is set up as per your requirements
|
|
54
|
+
user = autogen.UserProxyAgent(
|
|
55
|
+
name="User",
|
|
56
|
+
human_input_mode="NEVER",
|
|
57
|
+
is_termination_msg=lambda x: (x.get("content") or "").rstrip().endswith("TERMINATE"),
|
|
58
|
+
code_execution_config={
|
|
59
|
+
"work_dir": "coding",
|
|
60
|
+
"use_docker": False,
|
|
61
|
+
},
|
|
62
|
+
# additional setup for the user proxy agent
|
|
63
|
+
)
|
|
64
|
+
response = user.initiate_chats(tasks)
|
|
65
|
+
result = "### Output ###\n"+response[-1].summary if hasattr(response[-1], 'summary') else ""
|
|
66
|
+
else:
|
|
67
|
+
for role, details in config['roles'].items():
|
|
68
|
+
role_filled = details['role'].format(topic=topic)
|
|
69
|
+
goal_filled = details['goal'].format(topic=topic)
|
|
70
|
+
backstory_filled = details['backstory'].format(topic=topic)
|
|
71
|
+
|
|
72
|
+
# Assume tools are loaded and handled here as per your requirements
|
|
73
|
+
agent = Agent(role=role_filled, goal=goal_filled, backstory=backstory_filled)
|
|
74
|
+
agents[role] = agent
|
|
75
|
+
|
|
76
|
+
for task_name, task_details in details.get('tasks', {}).items():
|
|
77
|
+
description_filled = task_details['description'].format(topic=topic)
|
|
78
|
+
expected_output_filled = task_details['expected_output'].format(topic=topic)
|
|
79
|
+
|
|
80
|
+
task = Task(description=description_filled, expected_output=expected_output_filled, agent=agent)
|
|
81
|
+
tasks.append(task)
|
|
82
|
+
|
|
83
|
+
crew = Crew(
|
|
84
|
+
agents=list(agents.values()),
|
|
85
|
+
tasks=tasks,
|
|
86
|
+
verbose=2
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
result = crew.kickoff()
|
|
90
|
+
return result
|
|
91
|
+
|
|
92
|
+
def main(args=None):
|
|
93
|
+
if args is None:
|
|
94
|
+
args = sys.argv[1:] # Skip the script name
|
|
95
|
+
|
|
96
|
+
invocation_cmd = "praisonai"
|
|
97
|
+
version_string = f"PraisonAI version {__version__}"
|
|
98
|
+
framework = "crewai" # Default framework
|
|
99
|
+
|
|
100
|
+
if "--framework" in args:
|
|
101
|
+
framework_index = args.index("--framework")
|
|
102
|
+
framework = args[framework_index + 1]
|
|
103
|
+
args = args[:framework_index] + args[framework_index + 2:]
|
|
104
|
+
|
|
105
|
+
if args:
|
|
106
|
+
agent_file = args[-1] # Assuming the last argument is the agent file
|
|
107
|
+
else:
|
|
108
|
+
agent_file = "agents.yaml"
|
|
109
|
+
|
|
110
|
+
result = generate_crew_and_kickoff(agent_file, framework)
|
|
111
|
+
print(result)
|
|
112
|
+
|
|
113
|
+
if __name__ == "__main__":
|
|
114
|
+
main()
|
praisonAI/test.py
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import yaml, os
|
|
2
|
+
from rich import print
|
|
3
|
+
from dotenv import load_dotenv
|
|
4
|
+
from crewai import Agent, Task, Crew
|
|
5
|
+
load_dotenv()
|
|
6
|
+
import autogen
|
|
7
|
+
config_list = [
|
|
8
|
+
{
|
|
9
|
+
'model': os.environ.get("OPENAI_MODEL_NAME", "gpt-3.5-turbo"),
|
|
10
|
+
'base_url': os.environ.get("OPENAI_API_BASE", "https://api.openai.com/v1"),
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
def generate_crew_and_kickoff(agent_file):
|
|
15
|
+
with open(agent_file, 'r') as f:
|
|
16
|
+
config = yaml.safe_load(f)
|
|
17
|
+
|
|
18
|
+
topic = config['topic']
|
|
19
|
+
framework = config['framework']
|
|
20
|
+
|
|
21
|
+
agents = {}
|
|
22
|
+
tasks = []
|
|
23
|
+
if framework == "autogen":
|
|
24
|
+
# Load the LLM configuration dynamically
|
|
25
|
+
print(config_list)
|
|
26
|
+
llm_config = {"config_list": config_list}
|
|
27
|
+
|
|
28
|
+
for role, details in config['roles'].items():
|
|
29
|
+
agent_name = details['role'].format(topic=topic).replace("{topic}", topic)
|
|
30
|
+
agent_goal = details['goal'].format(topic=topic)
|
|
31
|
+
# Creating an AssistantAgent for each role dynamically
|
|
32
|
+
agents[role] = autogen.AssistantAgent(
|
|
33
|
+
name=agent_name,
|
|
34
|
+
llm_config=llm_config,
|
|
35
|
+
system_message=details['backstory'].format(topic=topic)+". Reply \"TERMINATE\" in the end when everything is done.",
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
# Preparing tasks for initiate_chats
|
|
39
|
+
for task_name, task_details in details.get('tasks', {}).items():
|
|
40
|
+
description_filled = task_details['description'].format(topic=topic)
|
|
41
|
+
expected_output_filled = task_details['expected_output'].format(topic=topic)
|
|
42
|
+
|
|
43
|
+
chat_task = {
|
|
44
|
+
"recipient": agents[role],
|
|
45
|
+
"message": description_filled,
|
|
46
|
+
"summary_method": "last_msg", # Customize as needed
|
|
47
|
+
# Additional fields like carryover can be added based on dependencies
|
|
48
|
+
}
|
|
49
|
+
tasks.append(chat_task)
|
|
50
|
+
|
|
51
|
+
# Assuming the user proxy agent is set up as per your requirements
|
|
52
|
+
user = autogen.UserProxyAgent(
|
|
53
|
+
name="User",
|
|
54
|
+
human_input_mode="NEVER",
|
|
55
|
+
is_termination_msg=lambda x: (x.get("content") or "").rstrip().endswith("TERMINATE"),
|
|
56
|
+
code_execution_config={
|
|
57
|
+
"work_dir": "coding",
|
|
58
|
+
"use_docker": False,
|
|
59
|
+
},
|
|
60
|
+
# additional setup for the user proxy agent
|
|
61
|
+
)
|
|
62
|
+
response = user.initiate_chats(tasks)
|
|
63
|
+
result = "### Output ###\n"+response[-1].summary if hasattr(response[-1], 'summary') else ""
|
|
64
|
+
else:
|
|
65
|
+
for role, details in config['roles'].items():
|
|
66
|
+
role_filled = details['role'].format(topic=topic)
|
|
67
|
+
goal_filled = details['goal'].format(topic=topic)
|
|
68
|
+
backstory_filled = details['backstory'].format(topic=topic)
|
|
69
|
+
|
|
70
|
+
# Assume tools are loaded and handled here as per your requirements
|
|
71
|
+
agent = Agent(role=role_filled, goal=goal_filled, backstory=backstory_filled)
|
|
72
|
+
agents[role] = agent
|
|
73
|
+
|
|
74
|
+
for task_name, task_details in details.get('tasks', {}).items():
|
|
75
|
+
description_filled = task_details['description'].format(topic=topic)
|
|
76
|
+
expected_output_filled = task_details['expected_output'].format(topic=topic)
|
|
77
|
+
|
|
78
|
+
task = Task(description=description_filled, expected_output=expected_output_filled, agent=agent)
|
|
79
|
+
tasks.append(task)
|
|
80
|
+
|
|
81
|
+
crew = Crew(
|
|
82
|
+
agents=list(agents.values()),
|
|
83
|
+
tasks=tasks,
|
|
84
|
+
verbose=2
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
result = crew.kickoff()
|
|
88
|
+
return result
|
|
89
|
+
|
|
90
|
+
if __name__ == "__main__":
|
|
91
|
+
agent_file = "agents.yaml"
|
|
92
|
+
result = generate_crew_and_kickoff(agent_file)
|
|
93
|
+
print(result)
|
praisonAI/version.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.0.1"
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: praisonAI
|
|
3
|
+
Version: 0.0.1
|
|
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
|
+
Author: Mervin Praison
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
|
|
8
|
+
# Praison AI
|
|
9
|
+
|
|
10
|
+
Praison AI, leveraging both AutoGen and CrewAI or any other agent framework, represents a low-code, centralised framework designed to simplify the creation and orchestration of multi-agent systems for various LLM applications, emphasizing ease of use, customization, and human-agent interaction.
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pip install praisonai
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Run
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
praisonai
|
|
22
|
+
```
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
praisonAI/__init__.py,sha256=8zLGg-DfQhnDl2Ky0n-zXpN-8e-g7iR0AcaI4l4Vvpk,32
|
|
2
|
+
praisonAI/__main__.py,sha256=0g3iknXOS9gZUcpL_trgAcuCJnZZKjdsT_xt61WOVb4,60
|
|
3
|
+
praisonAI/cli.py,sha256=OQYvURs2HCxoUruhAhkolqSAnx7kXxaeg2XzUPZMwIw,4345
|
|
4
|
+
praisonAI/test.py,sha256=4bAqitWeywjZtxoOAdcBTLaYDRflZH3LSYtOpWrZBI4,3707
|
|
5
|
+
praisonAI/version.py,sha256=ugyuFliEqtAwQmH4sTlc16YXKYbFWDmfyk87fErB8-8,21
|
|
6
|
+
praisonAI-0.0.1.dist-info/METADATA,sha256=nHYm4Z2hEsqYeEDZs5N8_UfCTIip9Bj4adIiGIGhto4,747
|
|
7
|
+
praisonAI-0.0.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
8
|
+
praisonAI-0.0.1.dist-info/top_level.txt,sha256=7tEg2pqQqKr4CaCDaFHktvbpEswYcW-pHXGrAwY-6qk,10
|
|
9
|
+
praisonAI-0.0.1.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
praisonAI
|