PraisonAI 0.0.38__py3-none-any.whl → 0.0.39__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/agents_generator.py +14 -9
- praisonai/cli.py +5 -3
- praisonai/deploy.py +1 -1
- {praisonai-0.0.38.dist-info → praisonai-0.0.39.dist-info}/METADATA +1 -1
- {praisonai-0.0.38.dist-info → praisonai-0.0.39.dist-info}/RECORD +8 -8
- {praisonai-0.0.38.dist-info → praisonai-0.0.39.dist-info}/LICENSE +0 -0
- {praisonai-0.0.38.dist-info → praisonai-0.0.39.dist-info}/WHEEL +0 -0
- {praisonai-0.0.38.dist-info → praisonai-0.0.39.dist-info}/entry_points.txt +0 -0
praisonai/agents_generator.py
CHANGED
|
@@ -47,7 +47,7 @@ def disable_crewai_telemetry():
|
|
|
47
47
|
disable_crewai_telemetry()
|
|
48
48
|
|
|
49
49
|
class AgentsGenerator:
|
|
50
|
-
def __init__(self, agent_file, framework, config_list, log_level=None, agent_callback=None, task_callback=None):
|
|
50
|
+
def __init__(self, agent_file, framework, config_list, log_level=None, agent_callback=None, task_callback=None, agent_yaml=None):
|
|
51
51
|
"""
|
|
52
52
|
Initialize the AgentsGenerator object.
|
|
53
53
|
|
|
@@ -58,6 +58,7 @@ class AgentsGenerator:
|
|
|
58
58
|
log_level (int, optional): The logging level to use. Defaults to logging.INFO.
|
|
59
59
|
agent_callback (callable, optional): A callback function to be executed after each agent step.
|
|
60
60
|
task_callback (callable, optional): A callback function to be executed after each tool run.
|
|
61
|
+
agent_yaml (str, optional): The content of the YAML file. Defaults to None.
|
|
61
62
|
|
|
62
63
|
Attributes:
|
|
63
64
|
agent_file (str): The path to the agent file.
|
|
@@ -73,6 +74,7 @@ class AgentsGenerator:
|
|
|
73
74
|
self.log_level = log_level
|
|
74
75
|
self.agent_callback = agent_callback
|
|
75
76
|
self.task_callback = task_callback
|
|
77
|
+
self.agent_yaml = agent_yaml
|
|
76
78
|
self.log_level = log_level or logging.getLogger().getEffectiveLevel()
|
|
77
79
|
if self.log_level == logging.NOTSET:
|
|
78
80
|
self.log_level = os.environ.get('LOGLEVEL', 'INFO').upper()
|
|
@@ -170,14 +172,17 @@ class AgentsGenerator:
|
|
|
170
172
|
|
|
171
173
|
This function first loads the agent configuration from the specified file. It then initializes the tools required for the agents based on the specified framework. If the specified framework is "autogen", it loads the LLM configuration dynamically and creates an AssistantAgent for each role in the configuration. It then adds tools to the agents if specified in the configuration. Finally, it prepares tasks for the agents based on the configuration and initiates the tasks using the crew of agents. If the specified framework is not "autogen", it creates a crew of agents and initiates tasks based on the configuration.
|
|
172
174
|
"""
|
|
173
|
-
if self.
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
175
|
+
if self.agent_yaml:
|
|
176
|
+
config = yaml.safe_load(self.agent_yaml)
|
|
177
|
+
else:
|
|
178
|
+
if self.agent_file == '/app/api:app' or self.agent_file == 'api:app':
|
|
179
|
+
self.agent_file = 'agents.yaml'
|
|
180
|
+
try:
|
|
181
|
+
with open(self.agent_file, 'r') as f:
|
|
182
|
+
config = yaml.safe_load(f)
|
|
183
|
+
except FileNotFoundError:
|
|
184
|
+
print(f"File not found: {self.agent_file}")
|
|
185
|
+
return
|
|
181
186
|
|
|
182
187
|
topic = config['topic']
|
|
183
188
|
tools_dict = {
|
praisonai/cli.py
CHANGED
|
@@ -29,7 +29,7 @@ except ImportError:
|
|
|
29
29
|
GRADIO_AVAILABLE = False
|
|
30
30
|
|
|
31
31
|
class PraisonAI:
|
|
32
|
-
def __init__(self, agent_file="agents.yaml", framework="", auto=False, init=False):
|
|
32
|
+
def __init__(self, agent_file="agents.yaml", framework="", auto=False, init=False, agent_yaml=None):
|
|
33
33
|
"""
|
|
34
34
|
Initialize the PraisonAI object with default parameters.
|
|
35
35
|
|
|
@@ -45,7 +45,9 @@ class PraisonAI:
|
|
|
45
45
|
framework (str): The framework to use.
|
|
46
46
|
auto (bool): A flag indicating whether to enable auto mode.
|
|
47
47
|
init (bool): A flag indicating whether to enable initialization mode.
|
|
48
|
+
agent_yaml (str, optional): The content of the YAML file. Defaults to None.
|
|
48
49
|
"""
|
|
50
|
+
self.agent_yaml = agent_yaml
|
|
49
51
|
self.config_list = [
|
|
50
52
|
{
|
|
51
53
|
'model': os.environ.get("OPENAI_MODEL_NAME", "gpt-4o"),
|
|
@@ -121,11 +123,11 @@ class PraisonAI:
|
|
|
121
123
|
self.create_chainlit_interface()
|
|
122
124
|
else:
|
|
123
125
|
# Modify below code to allow default ui
|
|
124
|
-
agents_generator = AgentsGenerator(self.agent_file, self.framework, self.config_list)
|
|
126
|
+
agents_generator = AgentsGenerator(self.agent_file, self.framework, self.config_list, agent_yaml=self.agent_yaml)
|
|
125
127
|
result = agents_generator.generate_crew_and_kickoff()
|
|
126
128
|
return result
|
|
127
129
|
else:
|
|
128
|
-
agents_generator = AgentsGenerator(self.agent_file, self.framework, self.config_list)
|
|
130
|
+
agents_generator = AgentsGenerator(self.agent_file, self.framework, self.config_list, agent_yaml=self.agent_yaml)
|
|
129
131
|
result = agents_generator.generate_crew_and_kickoff()
|
|
130
132
|
return result
|
|
131
133
|
|
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.
|
|
59
|
+
file.write("RUN pip install flask praisonai==0.0.39 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
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PraisonAI
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.39
|
|
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
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
praisonai/__init__.py,sha256=JrgyPlzZfLlozoW7SHZ1nVJ63rLPR3ki2k5ZPywYrnI,175
|
|
2
2
|
praisonai/__main__.py,sha256=MVgsjMThjBexHt4nhd760JCqvP4x0IQcwo8kULOK4FQ,144
|
|
3
|
-
praisonai/agents_generator.py,sha256=
|
|
3
|
+
praisonai/agents_generator.py,sha256=DoRYanu16HIAcmIcxiWeHaklfY_IaFb3CUoqBvhOh4A,16930
|
|
4
4
|
praisonai/auto.py,sha256=9spTXqj47Hmmqv5QHRYE_RzSVHH_KoPbaZjskUj2UcE,7895
|
|
5
5
|
praisonai/chainlit_ui.py,sha256=bNR7s509lp0I9JlJNvwCZRUZosC64qdvlFCt8NmFamQ,12216
|
|
6
|
-
praisonai/cli.py,sha256=
|
|
7
|
-
praisonai/deploy.py,sha256=
|
|
6
|
+
praisonai/cli.py,sha256=cwuXGubuac7yTeiqx5o5S7ZN7erZAfe-6p35b3HM5SU,11066
|
|
7
|
+
praisonai/deploy.py,sha256=suxuznJ9YRBG9NjMMR5lEVjSTIS_27dcy5ACaYaiZtU,6031
|
|
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
|
|
@@ -15,8 +15,8 @@ praisonai/public/movie.svg,sha256=aJ2EQ8vXZusVsF2SeuAVxP4RFJzQ14T26ejrGYdBgzk,12
|
|
|
15
15
|
praisonai/public/thriller.svg,sha256=2dYY72EcgbEyTxS4QzjAm37Y4srtPWEW4vCMFki98ZI,3163
|
|
16
16
|
praisonai/test.py,sha256=RZKq3UEFb6AnFFiHER3zBXfNmlteSLBlrTmOvnpnZLo,4092
|
|
17
17
|
praisonai/version.py,sha256=ugyuFliEqtAwQmH4sTlc16YXKYbFWDmfyk87fErB8-8,21
|
|
18
|
-
praisonai-0.0.
|
|
19
|
-
praisonai-0.0.
|
|
20
|
-
praisonai-0.0.
|
|
21
|
-
praisonai-0.0.
|
|
22
|
-
praisonai-0.0.
|
|
18
|
+
praisonai-0.0.39.dist-info/LICENSE,sha256=kqvFysVlnFxYOu0HxCe2HlmZmJtdmNGOxWRRkT9TsWc,1035
|
|
19
|
+
praisonai-0.0.39.dist-info/METADATA,sha256=OHIsvAkxdbEEXGMtAijYIspkd71u8a-XXjAP9cuebBA,10854
|
|
20
|
+
praisonai-0.0.39.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
21
|
+
praisonai-0.0.39.dist-info/entry_points.txt,sha256=Qg41eW3A1-dvdV5tF7LqChfYof8Rihk2rN1fiEE3vnk,53
|
|
22
|
+
praisonai-0.0.39.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|