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

@@ -200,6 +200,57 @@ class AgentsGenerator:
200
200
  tools_dict[name] = obj
201
201
  return tools_dict
202
202
 
203
+ def load_tools_from_tools_py(self):
204
+ """
205
+ Automatically loads all tools (functions and tool definitions) from tools.py file.
206
+
207
+ Returns:
208
+ dict: A dictionary containing:
209
+ - Function names as keys and function objects as values
210
+ - Tool definition names as keys and tool definition dictionaries as values
211
+
212
+ Note:
213
+ This function looks for:
214
+ 1. Regular functions
215
+ 2. Tool definition dictionaries (containing 'type' and 'function' keys)
216
+ 3. Variables named as tools or ending with '_tool'
217
+ """
218
+ tools_dict = {}
219
+ try:
220
+ # Try to import tools.py from current directory
221
+ spec = importlib.util.spec_from_file_location("tools", "tools.py")
222
+ if spec is None:
223
+ self.logger.warning("tools.py not found in current directory")
224
+ return tools_dict
225
+
226
+ module = importlib.util.module_from_spec(spec)
227
+ spec.loader.exec_module(module)
228
+
229
+ # Get all module attributes
230
+ for name, obj in inspect.getmembers(module):
231
+ # Skip private attributes
232
+ if name.startswith('_'):
233
+ continue
234
+
235
+ # Case 1: Regular functions
236
+ if inspect.isfunction(obj) and obj.__module__ == "tools":
237
+ tools_dict[name] = obj
238
+
239
+ # Case 2: Tool definition dictionaries
240
+ elif isinstance(obj, dict) and obj.get('type') == 'function' and 'function' in obj:
241
+ tools_dict[name] = obj
242
+
243
+ # Case 3: Variables named as tools
244
+ elif (name.endswith('_tool') or name == 'tools') and not inspect.ismodule(obj):
245
+ tools_dict[name] = obj
246
+
247
+ self.logger.debug(f"Loaded {len(tools_dict)} tools from tools.py")
248
+
249
+ except Exception as e:
250
+ self.logger.warning(f"Error loading tools from tools.py: {e}")
251
+
252
+ return tools_dict
253
+
203
254
  def generate_crew_and_kickoff(self):
204
255
  """
205
256
  Generates a crew of agents and initiates tasks based on the provided configuration.
@@ -271,7 +322,7 @@ class AgentsGenerator:
271
322
  elif tools_dir_path.is_dir():
272
323
  tools_dict.update(self.load_tools_from_module_class(tools_dir_path))
273
324
  self.logger.debug("tools folder exists in the root directory")
274
-
325
+
275
326
  framework = self.framework or config.get('framework')
276
327
 
277
328
  if framework == "autogen":
@@ -498,6 +549,8 @@ class AgentsGenerator:
498
549
  tasks = []
499
550
  tasks_dict = {}
500
551
 
552
+ tools_dict = self.load_tools_from_tools_py()
553
+
501
554
  # Create agents from config
502
555
  for role, details in config['roles'].items():
503
556
  role_filled = details['role'].format(topic=topic)
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==2.0.13 gunicorn markdown\n")
59
+ file.write("RUN pip install flask praisonai==2.0.14 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: 2.0.13
3
+ Version: 2.0.14
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
@@ -46,7 +46,7 @@ Requires-Dist: openai (>=1.54.0) ; extra == "call"
46
46
  Requires-Dist: playwright (>=1.47.0) ; extra == "chat" or extra == "code"
47
47
  Requires-Dist: plotly (>=5.24.0) ; extra == "realtime"
48
48
  Requires-Dist: praisonai-tools (>=0.0.7) ; extra == "crewai" or extra == "autogen"
49
- Requires-Dist: praisonaiagents (>=0.0.4)
49
+ Requires-Dist: praisonaiagents (>=0.0.6)
50
50
  Requires-Dist: pyautogen (>=0.2.19) ; extra == "autogen"
51
51
  Requires-Dist: pydantic (<=2.10.1) ; extra == "chat" or extra == "code"
52
52
  Requires-Dist: pyngrok (>=1.4.0) ; extra == "call"
@@ -100,6 +100,115 @@ PraisonAI is an AI Agents Framework with Self Reflection. PraisonAI application
100
100
  - 👁️ Vision Language Model (VLM) Support
101
101
  - 🎙️ Real-time Voice Interaction
102
102
 
103
+ ## Using No Code
104
+
105
+ ### Auto Mode:
106
+ ```bash
107
+ pip install praisonai
108
+ export OPENAI_API_KEY=xxxxxxxxxxxxxxxxxxxxxx
109
+ praisonai --auto create a movie script about Robots in Mars
110
+ ```
111
+
112
+ ### Initialise Mode:
113
+ ```bash
114
+ pip install praisonai
115
+ export OPENAI_API_KEY=xxxxxxxxxxxxxxxxxxxxxx
116
+ praisonai --init create a movie script about Robots in Mars
117
+ praisonai
118
+ ```
119
+
120
+ ## Using Coding
121
+
122
+ Light weight package dedicated for coding:
123
+ ```bash
124
+ pip install praisonaiagents
125
+ ```
126
+
127
+ ```bash
128
+ export OPENAI_API_KEY=xxxxxxxxxxxxxxxxxxxxxx
129
+ ```
130
+
131
+ Create app.py file and add the code below:
132
+ ```python
133
+ from praisonaiagents import Agent, Task, PraisonAIAgents
134
+
135
+ # 1. Create agents
136
+ researcher = Agent(
137
+ name="Researcher",
138
+ role="Senior Research Analyst",
139
+ goal="Uncover cutting-edge developments in AI and data science",
140
+ backstory="""You are an expert at a technology research group,
141
+ skilled in identifying trends and analyzing complex data.""",
142
+ verbose=True,
143
+ llm="gpt-4o",
144
+ markdown=True
145
+ )
146
+ writer = Agent(
147
+ name="Writer",
148
+ role="Tech Content Strategist",
149
+ goal="Craft compelling content on tech advancements",
150
+ backstory="""You are a content strategist known for
151
+ making complex tech topics interesting and easy to understand.""",
152
+ llm="gpt-4o",
153
+ markdown=True
154
+ )
155
+
156
+ # 2. Define Tasks
157
+ task1 = Task(
158
+ name="research_task",
159
+ description="""Analyze 2024's AI advancements.
160
+ Find major trends, new technologies, and their effects.""",
161
+ expected_output="""A detailed report on 2024 AI advancements""",
162
+ agent=researcher
163
+ )
164
+
165
+ task2 = Task(
166
+ name="writing_task",
167
+ description="""Create a blog post about major AI advancements using the insights you have.
168
+ Make it interesting, clear, and suited for tech enthusiasts.
169
+ It should be at least 4 paragraphs long.""",
170
+ expected_output="A blog post of at least 4 paragraphs",
171
+ agent=writer,
172
+ )
173
+
174
+ agents = PraisonAIAgents(
175
+ agents=[researcher, writer],
176
+ tasks=[task1, task2],
177
+ verbose=False,
178
+ process="hierarchical",
179
+ manager_llm="gpt-4o"
180
+ )
181
+
182
+ result = agents.start()
183
+ ```
184
+
185
+ Run:
186
+ ```bash
187
+ python app.py
188
+ ```
189
+
190
+ ## Ollama Integration
191
+ ```bash
192
+ export OPENAI_BASE_URL=http://localhost:11434/v1
193
+ ```
194
+
195
+ ## Groq Integration
196
+ Replace xxxx with Groq API KEY:
197
+ ```bash
198
+ export OPENAI_API_KEY=xxxxxxxxxxx
199
+ export OPENAI_BASE_URL=https://api.groq.com/openai/v1
200
+ ```
201
+
202
+ ## Logging
203
+ ```bash
204
+ export LOGLEVEL=info
205
+ ```
206
+
207
+ Advanced logging:
208
+ ```bash
209
+ export LOGLEVEL=debug
210
+ ```
211
+
103
212
  <div align="center">
104
213
  <picture>
105
214
  <source media="(prefers-color-scheme: dark)" srcset="docs/images/architecture-dark.png" />
@@ -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=9-KuU1--_cBI85y2J-9XjW0LYHTCMnKJhy5WAUrf3M0,26887
3
+ praisonai/agents_generator.py,sha256=D9UOVyx0dzRw02rQ_qI1nU3sxqayY5PDy3t4OMW-ty8,29027
4
4
  praisonai/api/call.py,sha256=iHdAlgIH_oTsEbjaGGu1Jjo6DTfMR-SfFdtSxnOLCeY,11032
5
5
  praisonai/auto.py,sha256=uLDm8CU3L_3amZsd55yzf9RdBF1uW-BGSx7nl9ctNZ4,8680
6
6
  praisonai/chainlit_ui.py,sha256=bNR7s509lp0I9JlJNvwCZRUZosC64qdvlFCt8NmFamQ,12216
7
7
  praisonai/cli.py,sha256=O7abKND2MP_yDdD_OclPoiZG1JRoGc4u9KowbRzuQuQ,21209
8
- praisonai/deploy.py,sha256=RMxkqUx8H86M0SxU4Q8FRRegI8IOZJyDl1w7n908AOk,6028
8
+ praisonai/deploy.py,sha256=3ju6sshl_r8vpQdTi9Vy5o80BGmgBnl1C_UIvd4b8ZA,6028
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
@@ -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-2.0.13.dist-info/LICENSE,sha256=kqvFysVlnFxYOu0HxCe2HlmZmJtdmNGOxWRRkT9TsWc,1035
79
- praisonai-2.0.13.dist-info/METADATA,sha256=zNLpkGzUiK7tIr2BBBnZxJMmYiVrI4DjJEvCF78nrFs,17337
80
- praisonai-2.0.13.dist-info/WHEEL,sha256=x1HiyTP_r-PIOu3STHzjukjf5kVLXzgVftSXf5bl8AU,110
81
- praisonai-2.0.13.dist-info/entry_points.txt,sha256=I_xc6a6MNTTfLxYmAxe0rgey0G-_hbY07oFW-ZDnkw4,135
82
- praisonai-2.0.13.dist-info/RECORD,,
78
+ praisonai-2.0.14.dist-info/LICENSE,sha256=kqvFysVlnFxYOu0HxCe2HlmZmJtdmNGOxWRRkT9TsWc,1035
79
+ praisonai-2.0.14.dist-info/METADATA,sha256=dvtsFA033SuzQt3yS8kwhPhQBDeUGtXbyyvs6cfJRVM,19757
80
+ praisonai-2.0.14.dist-info/WHEEL,sha256=x1HiyTP_r-PIOu3STHzjukjf5kVLXzgVftSXf5bl8AU,110
81
+ praisonai-2.0.14.dist-info/entry_points.txt,sha256=I_xc6a6MNTTfLxYmAxe0rgey0G-_hbY07oFW-ZDnkw4,135
82
+ praisonai-2.0.14.dist-info/RECORD,,