PraisonAI 0.0.7__tar.gz → 0.0.9__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: praisonAI
3
- Version: 0.0.7
3
+ Version: 0.0.9
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
@@ -2,6 +2,9 @@
2
2
 
3
3
  from .cli import PraisonAI
4
4
 
5
- if __name__ == "__main__":
5
+ def main():
6
6
  praison_ai = PraisonAI()
7
- praison_ai.main()
7
+ praison_ai.main()
8
+
9
+ if __name__ == "__main__":
10
+ main()
@@ -70,8 +70,6 @@ class AutoGenerator:
70
70
  "roles": {},
71
71
  "dependencies": []
72
72
  }
73
- print(self.topic)
74
- print(self.framework)
75
73
 
76
74
  for role_id, role_details in json_data['roles'].items():
77
75
  yaml_data['roles'][role_id] = {
@@ -131,5 +129,5 @@ The final role you create should satisfy the provided task: """ + self.topic + "
131
129
  return user_content
132
130
 
133
131
 
134
- generator = AutoGenerator(framework="crewai", topic="Create a snake game in python")
135
- print(generator.generate())
132
+ # generator = AutoGenerator(framework="crewai", topic="Create a snake game in python")
133
+ # print(generator.generate())
@@ -13,7 +13,7 @@ import argparse
13
13
  from .auto import AutoGenerator
14
14
 
15
15
  class PraisonAI:
16
- def __init__(self, agent_file="agents.yaml", framework="crewai", auto=False):
16
+ def __init__(self, agent_file="agents.yaml", framework="crewai", auto=False, init=False):
17
17
  self.config_list = [
18
18
  {
19
19
  'model': os.environ.get("OPENAI_MODEL_NAME", "gpt-4-turbo-preview"),
@@ -23,6 +23,7 @@ class PraisonAI:
23
23
  self.agent_file = agent_file
24
24
  self.framework = framework
25
25
  self.auto = auto
26
+ self.init = init
26
27
 
27
28
  def generate_crew_and_kickoff(self):
28
29
  with open(self.agent_file, 'r') as f:
@@ -35,7 +36,7 @@ class PraisonAI:
35
36
  tasks = []
36
37
  if framework == "autogen":
37
38
  # Load the LLM configuration dynamically
38
- print(self.config_list)
39
+ # print(self.config_list)
39
40
  llm_config = {"config_list": self.config_list}
40
41
 
41
42
  for role, details in config['roles'].items():
@@ -114,21 +115,33 @@ class PraisonAI:
114
115
  ui = args.ui # Default UI flag
115
116
 
116
117
  if args.agent_file:
117
- self.agent_file = args.agent_file
118
+ if args.agent_file == "tests.test": # Argument used for testing purposes
119
+ full_path = os.path.abspath("agents.yaml")
120
+ else:
121
+ full_path = os.path.abspath(args.agent_file)
122
+ self.agent_file = full_path
118
123
  else:
119
124
  full_path = os.path.abspath(self.agent_file)
120
125
  self.filename = full_path
121
126
 
122
- if args.auto:
123
- self.topic = ' '.join(args.auto)
124
- elif self.auto: # Use the auto attribute if args.auto is not provided
127
+ if args.auto or args.init:
128
+ temp_topic = ' '.join(args.auto) if args.auto else ' '.join(args.init)
129
+ self.topic = temp_topic
130
+ elif self.auto or self.init: # Use the auto attribute if args.auto is not provided
125
131
  self.topic = self.auto
126
132
 
127
133
  if args.auto or self.auto:
134
+ self.filename = "test.yaml"
128
135
  generator = AutoGenerator(topic=self.topic , framework=self.framework)
129
136
  self.agent_file = generator.generate()
130
137
  result = self.generate_crew_and_kickoff()
131
138
  return result
139
+ elif args.init or self.init:
140
+ self.filename = "agents.yaml"
141
+ generator = AutoGenerator(topic=self.topic , framework=self.framework, filename=self.filename)
142
+ self.agent_file = generator.generate()
143
+ print("File {} created successfully".format(self.agent_file))
144
+ return "File {} created successfully".format(self.agent_file)
132
145
 
133
146
  if ui:
134
147
  self.create_gradio_interface()
@@ -141,6 +154,7 @@ class PraisonAI:
141
154
  parser.add_argument("--framework", choices=["crewai", "autogen"], default="crewai", help="Specify the framework")
142
155
  parser.add_argument("--ui", action="store_true", help="Enable UI mode")
143
156
  parser.add_argument("--auto", nargs=argparse.REMAINDER, help="Enable auto mode and pass arguments for it")
157
+ parser.add_argument("--init", nargs=argparse.REMAINDER, help="Enable auto mode and pass arguments for it")
144
158
  parser.add_argument("agent_file", nargs="?", help="Specify the agent file")
145
159
 
146
160
  return parser.parse_args()
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "praisonAI"
3
- version = "0.0.7"
3
+ version = "0.0.9"
4
4
  description = "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
  authors = ["Mervin Praison"]
6
6
  license = ""
File without changes
File without changes