PraisonAI 0.0.45__tar.gz → 0.0.47__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.

Potentially problematic release.


This version of PraisonAI might be problematic. Click here for more details.

Files changed (38) hide show
  1. {praisonai-0.0.45 → praisonai-0.0.47}/PKG-INFO +77 -57
  2. {praisonai-0.0.45 → praisonai-0.0.47}/README.md +76 -56
  3. {praisonai-0.0.45 → praisonai-0.0.47}/praisonai/cli.py +15 -0
  4. {praisonai-0.0.45 → praisonai-0.0.47}/praisonai/deploy.py +3 -3
  5. praisonai-0.0.47/praisonai/ui/chat.py +303 -0
  6. praisonai-0.0.47/praisonai/ui/sql_alchemy.py +638 -0
  7. {praisonai-0.0.45 → praisonai-0.0.47}/pyproject.toml +1 -1
  8. praisonai-0.0.45/praisonai/ui/chat.py +0 -438
  9. {praisonai-0.0.45 → praisonai-0.0.47}/LICENSE +0 -0
  10. {praisonai-0.0.45 → praisonai-0.0.47}/praisonai/__init__.py +0 -0
  11. {praisonai-0.0.45 → praisonai-0.0.47}/praisonai/__main__.py +0 -0
  12. {praisonai-0.0.45 → praisonai-0.0.47}/praisonai/agents_generator.py +0 -0
  13. {praisonai-0.0.45 → praisonai-0.0.47}/praisonai/auto.py +0 -0
  14. {praisonai-0.0.45 → praisonai-0.0.47}/praisonai/chainlit_ui.py +0 -0
  15. {praisonai-0.0.45 → praisonai-0.0.47}/praisonai/inbuilt_tools/__init__.py +0 -0
  16. {praisonai-0.0.45 → praisonai-0.0.47}/praisonai/inbuilt_tools/autogen_tools.py +0 -0
  17. {praisonai-0.0.45 → praisonai-0.0.47}/praisonai/inc/__init__.py +0 -0
  18. {praisonai-0.0.45 → praisonai-0.0.47}/praisonai/inc/models.py +0 -0
  19. {praisonai-0.0.45 → praisonai-0.0.47}/praisonai/public/android-chrome-192x192.png +0 -0
  20. {praisonai-0.0.45 → praisonai-0.0.47}/praisonai/public/android-chrome-512x512.png +0 -0
  21. {praisonai-0.0.45 → praisonai-0.0.47}/praisonai/public/apple-touch-icon.png +0 -0
  22. {praisonai-0.0.45 → praisonai-0.0.47}/praisonai/public/fantasy.svg +0 -0
  23. {praisonai-0.0.45 → praisonai-0.0.47}/praisonai/public/favicon-16x16.png +0 -0
  24. {praisonai-0.0.45 → praisonai-0.0.47}/praisonai/public/favicon-32x32.png +0 -0
  25. {praisonai-0.0.45 → praisonai-0.0.47}/praisonai/public/favicon.ico +0 -0
  26. {praisonai-0.0.45 → praisonai-0.0.47}/praisonai/public/game.svg +0 -0
  27. {praisonai-0.0.45 → praisonai-0.0.47}/praisonai/public/logo_dark.png +0 -0
  28. {praisonai-0.0.45 → praisonai-0.0.47}/praisonai/public/logo_light.png +0 -0
  29. {praisonai-0.0.45 → praisonai-0.0.47}/praisonai/public/movie.svg +0 -0
  30. {praisonai-0.0.45 → praisonai-0.0.47}/praisonai/public/thriller.svg +0 -0
  31. {praisonai-0.0.45 → praisonai-0.0.47}/praisonai/test.py +0 -0
  32. {praisonai-0.0.45 → praisonai-0.0.47}/praisonai/ui/public/fantasy.svg +0 -0
  33. {praisonai-0.0.45 → praisonai-0.0.47}/praisonai/ui/public/game.svg +0 -0
  34. {praisonai-0.0.45 → praisonai-0.0.47}/praisonai/ui/public/logo_dark.png +0 -0
  35. {praisonai-0.0.45 → praisonai-0.0.47}/praisonai/ui/public/logo_light.png +0 -0
  36. {praisonai-0.0.45 → praisonai-0.0.47}/praisonai/ui/public/movie.svg +0 -0
  37. {praisonai-0.0.45 → praisonai-0.0.47}/praisonai/ui/public/thriller.svg +0 -0
  38. {praisonai-0.0.45 → praisonai-0.0.47}/praisonai/version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PraisonAI
3
- Version: 0.0.45
3
+ Version: 0.0.47
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
@@ -51,6 +51,11 @@ Description-Content-Type: text/markdown
51
51
 
52
52
  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.
53
53
 
54
+ | | Cookbook | Open in Colab |
55
+ | --- | --- | --- |
56
+ | Basic | PraisonAI | <a target="_blank" href="https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/cookbooks/praisonai-googlecolab.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> |
57
+ | Include Tools | PraisonAI Tools | <a target="_blank" href="https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/cookbooks/praisonai-tools-googlecolab.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> |
58
+
54
59
  ## TL;DR
55
60
  ```bash
56
61
  pip install praisonai
@@ -59,6 +64,22 @@ praisonai --init create a movie script about dog in moon
59
64
  praisonai
60
65
  ```
61
66
 
67
+ ## Table of Contents
68
+
69
+ - [Installation](#installation)
70
+ - [Initialise](#initialise)
71
+ - [Run](#run)
72
+ - [Full Automatic Mode](#full-automatic-mode)
73
+ - [User Interface](#user-interface)
74
+ - [Praison AI Chat](#praison-ai-chat)
75
+ - [Create Custom Tools](#create-custom-tools)
76
+ - [Agents Playbook](#agents-playbook)
77
+ - [Include praisonai package in your project](#include-praisonai-package-in-your-project)
78
+ - [Commands to Install Dev Dependencies](#commands-to-install-dependencies)
79
+ - [Other Models](#other-models)
80
+ - [Contributing](#contributing)
81
+ - [Star History](#star-history)
82
+
62
83
  ## Installation
63
84
 
64
85
  ```bash
@@ -126,29 +147,26 @@ or
126
147
  python -m praisonai ui
127
148
  ```
128
149
 
129
- ## Create Custom Tools
150
+ ## Praison AI Chat
130
151
 
131
- ### TL;DR to Create a Custom Tool
152
+ * https://docs.praison.ai/chat/
132
153
 
133
154
  ```bash
134
- pip install praisonai duckduckgo-search
155
+ pip install "praisonai[chat]"
135
156
  export OPENAI_API_KEY="Enter your API key"
136
- praisonai --init research about the latest AI News and prepare a detailed report
157
+ praisonai chat
137
158
  ```
138
159
 
139
- - Add `- InternetSearchTool` in the agents.yaml file in the tools section.
140
- - Create a file called tools.py and add this code [tools.py](./tools.py)
160
+ ## Create Custom Tools
141
161
 
142
- ```bash
143
- praisonai
144
- ```
162
+ * https://docs.praison.ai/tools/custom/
145
163
 
146
- ### Pre-requisite to Create a Custom Tool
164
+ ### Step 1: Pre-requisite to Create a Custom Tool
147
165
  `agents.yaml` file should be present in the current directory.
148
166
 
149
167
  If it doesn't exist, create it by running the command `praisonai --init research about the latest AI News and prepare a detailed report`.
150
168
 
151
- ### Step 1 to Create a Custom Tool
169
+ ### Step 2: to Create a Custom Tool
152
170
 
153
171
  Create a file called tools.py in the same directory as the agents.yaml file.
154
172
 
@@ -167,7 +185,7 @@ class InternetSearchTool(BaseTool):
167
185
  return results
168
186
  ```
169
187
 
170
- ### Step 2 to Create a Custom Tool
188
+ ### Step 3: to Create a Custom Tool
171
189
 
172
190
  Add the tool to the agents.yaml file as show below under the tools section `- InternetSearchTool`.
173
191
 
@@ -206,37 +224,63 @@ roles:
206
224
  expected_output: 'Complete script ready for production.'
207
225
  ```
208
226
 
227
+ ## Use 100+ Models
228
+
229
+ * https://docs.praison.ai/models/
230
+
209
231
  ## Include praisonai package in your project
210
232
 
233
+ * https://docs.praison.ai/developers/wrapper
234
+ * https://docs.praison.ai/developers/wrapper-tools/
235
+
236
+ ## Option 1: Using RAW YAML
237
+
238
+ ```python
239
+ from praisonai import PraisonAI
240
+
241
+ # Example agent_yaml content
242
+ agent_yaml = """
243
+ framework: "crewai"
244
+ topic: "Space Exploration"
245
+
246
+ roles:
247
+ astronomer:
248
+ role: "Space Researcher"
249
+ goal: "Discover new insights about {topic}"
250
+ backstory: "You are a curious and dedicated astronomer with a passion for unraveling the mysteries of the cosmos."
251
+ tasks:
252
+ investigate_exoplanets:
253
+ description: "Research and compile information about exoplanets discovered in the last decade."
254
+ expected_output: "A summarized report on exoplanet discoveries, including their size, potential habitability, and distance from Earth."
255
+ """
256
+
257
+ # Create a PraisonAI instance with the agent_yaml content
258
+ praisonai = PraisonAI(agent_yaml=agent_yaml)
259
+
260
+ # Run PraisonAI
261
+ result = praisonai.run()
262
+
263
+ # Print the result
264
+ print(result)
265
+ ```
266
+
267
+ ## Option 2: Using separate agents.yaml file
268
+
269
+
270
+ Note: Please create agents.yaml file before hand.
271
+
211
272
  ```python
212
273
  from praisonai import PraisonAI
213
274
 
214
275
  def basic(): # Basic Mode
215
- praison_ai = PraisonAI(agent_file="agents.yaml")
216
- praison_ai.main()
217
-
218
- def advanced(): # Advanced Mode with options
219
- praison_ai = PraisonAI(
220
- agent_file="agents.yaml",
221
- framework="autogen",
222
- )
223
- praison_ai.main()
224
-
225
- def auto(): # Full Automatic Mode
226
- praison_ai = PraisonAI(
227
- auto="Create a movie script about car in mars",
228
- framework="autogen"
229
- )
230
- print(praison_ai.framework)
231
- praison_ai.main()
276
+ praisonai = PraisonAI(agent_file="agents.yaml")
277
+ praisonai.run()
232
278
 
233
279
  if __name__ == "__main__":
234
280
  basic()
235
- advanced()
236
- auto()
237
281
  ```
238
282
 
239
- ### Commands to Install Dependencies:
283
+ ## Commands to Install Dependencies:
240
284
 
241
285
  1. **Install all dependencies, including dev dependencies:**
242
286
  ```sh
@@ -260,30 +304,6 @@ if __name__ == "__main__":
260
304
 
261
305
  This configuration ensures that your development dependencies are correctly categorized and installed as needed.
262
306
 
263
- ## Other Models
264
-
265
- ```bash
266
- # Ollama
267
- OPENAI_API_BASE='http://localhost:11434/v1'
268
- OPENAI_MODEL_NAME='mistral'
269
- OPENAI_API_KEY='NA'
270
-
271
- # FastChat
272
- OPENAI_API_BASE="http://localhost:8001/v1"
273
- OPENAI_MODEL_NAME='oh-2.5m7b-q51'
274
- OPENAI_API_KEY=NA
275
-
276
- # LM Studio
277
- OPENAI_API_BASE="http://localhost:1234/v1"
278
- OPENAI_MODEL_NAME=NA
279
- OPENAI_API_KEY=NA
280
-
281
- # Mistral API
282
- OPENAI_API_BASE=https://api.mistral.ai/v1
283
- OPENAI_MODEL_NAME="mistral-small"
284
- OPENAI_API_KEY=your-mistral-api-key
285
- ```
286
-
287
307
  ## Contributing
288
308
 
289
309
  - Fork on GitHub: Use the "Fork" button on the repository page.
@@ -13,6 +13,11 @@
13
13
 
14
14
  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.
15
15
 
16
+ | | Cookbook | Open in Colab |
17
+ | --- | --- | --- |
18
+ | Basic | PraisonAI | <a target="_blank" href="https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/cookbooks/praisonai-googlecolab.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> |
19
+ | Include Tools | PraisonAI Tools | <a target="_blank" href="https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/cookbooks/praisonai-tools-googlecolab.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> |
20
+
16
21
  ## TL;DR
17
22
  ```bash
18
23
  pip install praisonai
@@ -21,6 +26,22 @@ praisonai --init create a movie script about dog in moon
21
26
  praisonai
22
27
  ```
23
28
 
29
+ ## Table of Contents
30
+
31
+ - [Installation](#installation)
32
+ - [Initialise](#initialise)
33
+ - [Run](#run)
34
+ - [Full Automatic Mode](#full-automatic-mode)
35
+ - [User Interface](#user-interface)
36
+ - [Praison AI Chat](#praison-ai-chat)
37
+ - [Create Custom Tools](#create-custom-tools)
38
+ - [Agents Playbook](#agents-playbook)
39
+ - [Include praisonai package in your project](#include-praisonai-package-in-your-project)
40
+ - [Commands to Install Dev Dependencies](#commands-to-install-dependencies)
41
+ - [Other Models](#other-models)
42
+ - [Contributing](#contributing)
43
+ - [Star History](#star-history)
44
+
24
45
  ## Installation
25
46
 
26
47
  ```bash
@@ -88,29 +109,26 @@ or
88
109
  python -m praisonai ui
89
110
  ```
90
111
 
91
- ## Create Custom Tools
112
+ ## Praison AI Chat
92
113
 
93
- ### TL;DR to Create a Custom Tool
114
+ * https://docs.praison.ai/chat/
94
115
 
95
116
  ```bash
96
- pip install praisonai duckduckgo-search
117
+ pip install "praisonai[chat]"
97
118
  export OPENAI_API_KEY="Enter your API key"
98
- praisonai --init research about the latest AI News and prepare a detailed report
119
+ praisonai chat
99
120
  ```
100
121
 
101
- - Add `- InternetSearchTool` in the agents.yaml file in the tools section.
102
- - Create a file called tools.py and add this code [tools.py](./tools.py)
122
+ ## Create Custom Tools
103
123
 
104
- ```bash
105
- praisonai
106
- ```
124
+ * https://docs.praison.ai/tools/custom/
107
125
 
108
- ### Pre-requisite to Create a Custom Tool
126
+ ### Step 1: Pre-requisite to Create a Custom Tool
109
127
  `agents.yaml` file should be present in the current directory.
110
128
 
111
129
  If it doesn't exist, create it by running the command `praisonai --init research about the latest AI News and prepare a detailed report`.
112
130
 
113
- ### Step 1 to Create a Custom Tool
131
+ ### Step 2: to Create a Custom Tool
114
132
 
115
133
  Create a file called tools.py in the same directory as the agents.yaml file.
116
134
 
@@ -129,7 +147,7 @@ class InternetSearchTool(BaseTool):
129
147
  return results
130
148
  ```
131
149
 
132
- ### Step 2 to Create a Custom Tool
150
+ ### Step 3: to Create a Custom Tool
133
151
 
134
152
  Add the tool to the agents.yaml file as show below under the tools section `- InternetSearchTool`.
135
153
 
@@ -168,37 +186,63 @@ roles:
168
186
  expected_output: 'Complete script ready for production.'
169
187
  ```
170
188
 
189
+ ## Use 100+ Models
190
+
191
+ * https://docs.praison.ai/models/
192
+
171
193
  ## Include praisonai package in your project
172
194
 
195
+ * https://docs.praison.ai/developers/wrapper
196
+ * https://docs.praison.ai/developers/wrapper-tools/
197
+
198
+ ## Option 1: Using RAW YAML
199
+
200
+ ```python
201
+ from praisonai import PraisonAI
202
+
203
+ # Example agent_yaml content
204
+ agent_yaml = """
205
+ framework: "crewai"
206
+ topic: "Space Exploration"
207
+
208
+ roles:
209
+ astronomer:
210
+ role: "Space Researcher"
211
+ goal: "Discover new insights about {topic}"
212
+ backstory: "You are a curious and dedicated astronomer with a passion for unraveling the mysteries of the cosmos."
213
+ tasks:
214
+ investigate_exoplanets:
215
+ description: "Research and compile information about exoplanets discovered in the last decade."
216
+ expected_output: "A summarized report on exoplanet discoveries, including their size, potential habitability, and distance from Earth."
217
+ """
218
+
219
+ # Create a PraisonAI instance with the agent_yaml content
220
+ praisonai = PraisonAI(agent_yaml=agent_yaml)
221
+
222
+ # Run PraisonAI
223
+ result = praisonai.run()
224
+
225
+ # Print the result
226
+ print(result)
227
+ ```
228
+
229
+ ## Option 2: Using separate agents.yaml file
230
+
231
+
232
+ Note: Please create agents.yaml file before hand.
233
+
173
234
  ```python
174
235
  from praisonai import PraisonAI
175
236
 
176
237
  def basic(): # Basic Mode
177
- praison_ai = PraisonAI(agent_file="agents.yaml")
178
- praison_ai.main()
179
-
180
- def advanced(): # Advanced Mode with options
181
- praison_ai = PraisonAI(
182
- agent_file="agents.yaml",
183
- framework="autogen",
184
- )
185
- praison_ai.main()
186
-
187
- def auto(): # Full Automatic Mode
188
- praison_ai = PraisonAI(
189
- auto="Create a movie script about car in mars",
190
- framework="autogen"
191
- )
192
- print(praison_ai.framework)
193
- praison_ai.main()
238
+ praisonai = PraisonAI(agent_file="agents.yaml")
239
+ praisonai.run()
194
240
 
195
241
  if __name__ == "__main__":
196
242
  basic()
197
- advanced()
198
- auto()
199
243
  ```
200
244
 
201
- ### Commands to Install Dependencies:
245
+ ## Commands to Install Dependencies:
202
246
 
203
247
  1. **Install all dependencies, including dev dependencies:**
204
248
  ```sh
@@ -222,30 +266,6 @@ if __name__ == "__main__":
222
266
 
223
267
  This configuration ensures that your development dependencies are correctly categorized and installed as needed.
224
268
 
225
- ## Other Models
226
-
227
- ```bash
228
- # Ollama
229
- OPENAI_API_BASE='http://localhost:11434/v1'
230
- OPENAI_MODEL_NAME='mistral'
231
- OPENAI_API_KEY='NA'
232
-
233
- # FastChat
234
- OPENAI_API_BASE="http://localhost:8001/v1"
235
- OPENAI_MODEL_NAME='oh-2.5m7b-q51'
236
- OPENAI_API_KEY=NA
237
-
238
- # LM Studio
239
- OPENAI_API_BASE="http://localhost:1234/v1"
240
- OPENAI_MODEL_NAME=NA
241
- OPENAI_API_KEY=NA
242
-
243
- # Mistral API
244
- OPENAI_API_BASE=https://api.mistral.ai/v1
245
- OPENAI_MODEL_NAME="mistral-small"
246
- OPENAI_API_KEY=your-mistral-api-key
247
- ```
248
-
249
269
  ## Contributing
250
270
 
251
271
  - Fork on GitHub: Use the "Fork" button on the repository page.
@@ -60,6 +60,12 @@ class PraisonAI:
60
60
  self.auto = auto
61
61
  self.init = init
62
62
 
63
+ def run(self):
64
+ """
65
+ Run the PraisonAI application.
66
+ """
67
+ self.main()
68
+
63
69
  def main(self):
64
70
  """
65
71
  The main function of the PraisonAI object. It parses the command-line arguments,
@@ -188,6 +194,15 @@ class PraisonAI:
188
194
  if CHAINLIT_AVAILABLE:
189
195
  import praisonai
190
196
  os.environ["CHAINLIT_PORT"] = "8084"
197
+ public_folder = os.path.join(os.path.dirname(praisonai.__file__), 'public')
198
+ if not os.path.exists("public"): # Check if the folder exists in the current directory
199
+ if os.path.exists(public_folder):
200
+ shutil.copytree(public_folder, 'public', dirs_exist_ok=True)
201
+ logging.info("Public folder copied successfully!")
202
+ else:
203
+ logging.info("Public folder not found in the package.")
204
+ else:
205
+ logging.info("Public folder already exists.")
191
206
  chat_ui_path = os.path.join(os.path.dirname(praisonai.__file__), 'ui', 'chat.py')
192
207
  chainlit_run([chat_ui_path])
193
208
  else:
@@ -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.45 gunicorn markdown\n")
59
+ file.write("RUN pip install flask praisonai==0.0.47 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
 
@@ -78,8 +78,8 @@ class CloudDeployer:
78
78
  file.write("import markdown\n\n")
79
79
  file.write("app = Flask(__name__)\n\n")
80
80
  file.write("def basic():\n")
81
- file.write(" praison_ai = PraisonAI(agent_file=\"agents.yaml\")\n")
82
- file.write(" return praison_ai.main()\n\n")
81
+ file.write(" praisonai = PraisonAI(agent_file=\"agents.yaml\")\n")
82
+ file.write(" return praisonai.run()\n\n")
83
83
  file.write("@app.route('/')\n")
84
84
  file.write("def home():\n")
85
85
  file.write(" output = basic()\n")