PraisonAI 0.0.39__tar.gz → 0.0.46__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.
- {praisonai-0.0.39 → praisonai-0.0.46}/PKG-INFO +85 -136
- {praisonai-0.0.39 → praisonai-0.0.46}/README.md +81 -134
- {praisonai-0.0.39 → praisonai-0.0.46}/praisonai/agents_generator.py +25 -1
- {praisonai-0.0.39 → praisonai-0.0.46}/praisonai/cli.py +43 -1
- {praisonai-0.0.39 → praisonai-0.0.46}/praisonai/deploy.py +1 -1
- {praisonai-0.0.39 → praisonai-0.0.46}/praisonai/inc/models.py +4 -0
- praisonai-0.0.46/praisonai/public/android-chrome-192x192.png +0 -0
- praisonai-0.0.46/praisonai/public/android-chrome-512x512.png +0 -0
- praisonai-0.0.46/praisonai/public/apple-touch-icon.png +0 -0
- praisonai-0.0.46/praisonai/public/favicon-16x16.png +0 -0
- praisonai-0.0.46/praisonai/public/favicon-32x32.png +0 -0
- praisonai-0.0.46/praisonai/public/favicon.ico +0 -0
- praisonai-0.0.46/praisonai/public/logo_dark.png +0 -0
- praisonai-0.0.46/praisonai/public/logo_light.png +0 -0
- praisonai-0.0.46/praisonai/ui/chat.py +438 -0
- praisonai-0.0.46/praisonai/ui/public/fantasy.svg +3 -0
- praisonai-0.0.46/praisonai/ui/public/game.svg +3 -0
- praisonai-0.0.46/praisonai/ui/public/logo_dark.png +0 -0
- praisonai-0.0.46/praisonai/ui/public/logo_light.png +0 -0
- praisonai-0.0.46/praisonai/ui/public/movie.svg +3 -0
- praisonai-0.0.46/praisonai/ui/public/thriller.svg +3 -0
- {praisonai-0.0.39 → praisonai-0.0.46}/pyproject.toml +5 -2
- {praisonai-0.0.39 → praisonai-0.0.46}/LICENSE +0 -0
- {praisonai-0.0.39 → praisonai-0.0.46}/praisonai/__init__.py +0 -0
- {praisonai-0.0.39 → praisonai-0.0.46}/praisonai/__main__.py +0 -0
- {praisonai-0.0.39 → praisonai-0.0.46}/praisonai/auto.py +0 -0
- {praisonai-0.0.39 → praisonai-0.0.46}/praisonai/chainlit_ui.py +0 -0
- {praisonai-0.0.39 → praisonai-0.0.46}/praisonai/inbuilt_tools/__init__.py +0 -0
- {praisonai-0.0.39 → praisonai-0.0.46}/praisonai/inbuilt_tools/autogen_tools.py +0 -0
- {praisonai-0.0.39 → praisonai-0.0.46}/praisonai/inc/__init__.py +0 -0
- {praisonai-0.0.39 → praisonai-0.0.46}/praisonai/public/fantasy.svg +0 -0
- {praisonai-0.0.39 → praisonai-0.0.46}/praisonai/public/game.svg +0 -0
- {praisonai-0.0.39 → praisonai-0.0.46}/praisonai/public/movie.svg +0 -0
- {praisonai-0.0.39 → praisonai-0.0.46}/praisonai/public/thriller.svg +0 -0
- {praisonai-0.0.39 → praisonai-0.0.46}/praisonai/test.py +0 -0
- {praisonai-0.0.39 → praisonai-0.0.46}/praisonai/version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PraisonAI
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.46
|
|
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
|
|
@@ -11,13 +11,14 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
11
11
|
Provides-Extra: agentops
|
|
12
12
|
Provides-Extra: anthropic
|
|
13
13
|
Provides-Extra: api
|
|
14
|
+
Provides-Extra: chat
|
|
14
15
|
Provides-Extra: cohere
|
|
15
16
|
Provides-Extra: google
|
|
16
17
|
Provides-Extra: gradio
|
|
17
18
|
Provides-Extra: openai
|
|
18
19
|
Provides-Extra: ui
|
|
19
20
|
Requires-Dist: agentops (>=0.2.6) ; extra == "agentops"
|
|
20
|
-
Requires-Dist: chainlit (>=1.1.301,<2.0.0) ; extra == "ui"
|
|
21
|
+
Requires-Dist: chainlit (>=1.1.301,<2.0.0) ; extra == "ui" or extra == "chat"
|
|
21
22
|
Requires-Dist: crewai (>=0.32.0)
|
|
22
23
|
Requires-Dist: flask (>=3.0.0) ; extra == "api"
|
|
23
24
|
Requires-Dist: gradio (>=4.26.0) ; extra == "gradio"
|
|
@@ -25,6 +26,7 @@ Requires-Dist: langchain-anthropic (>=0.1.13) ; extra == "anthropic"
|
|
|
25
26
|
Requires-Dist: langchain-cohere (>=0.1.4) ; extra == "cohere"
|
|
26
27
|
Requires-Dist: langchain-google-genai (>=1.0.4) ; extra == "google"
|
|
27
28
|
Requires-Dist: langchain-openai (>=0.1.7) ; extra == "openai"
|
|
29
|
+
Requires-Dist: litellm (>=1.41.8) ; extra == "chat"
|
|
28
30
|
Requires-Dist: markdown (>=3.5)
|
|
29
31
|
Requires-Dist: praisonai-tools (>=0.0.7)
|
|
30
32
|
Requires-Dist: pyautogen (>=0.2.19)
|
|
@@ -34,10 +36,26 @@ Project-URL: Homepage, https://docs.praison.ai
|
|
|
34
36
|
Project-URL: Repository, https://github.com/mervinpraison/PraisonAI
|
|
35
37
|
Description-Content-Type: text/markdown
|
|
36
38
|
|
|
39
|
+
<p align="center">
|
|
40
|
+
<picture>
|
|
41
|
+
<source media="(prefers-color-scheme: dark)" srcset="docs/images/praisonai-logo-large.png">
|
|
42
|
+
<source media="(prefers-color-scheme: light)" srcset="docs/images/praisonai-logo-black-large.png">
|
|
43
|
+
<img alt="PraisonAI Logo" src="docs/images/praisonai-logo-black-large.png">
|
|
44
|
+
</picture>
|
|
45
|
+
</p>
|
|
46
|
+
<div align="center">
|
|
47
|
+
|
|
37
48
|
# Praison AI
|
|
38
49
|
|
|
50
|
+
</div>
|
|
51
|
+
|
|
39
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.
|
|
40
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
|
+
|
|
41
59
|
## TL;DR
|
|
42
60
|
```bash
|
|
43
61
|
pip install praisonai
|
|
@@ -46,6 +64,22 @@ praisonai --init create a movie script about dog in moon
|
|
|
46
64
|
praisonai
|
|
47
65
|
```
|
|
48
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
|
+
|
|
49
83
|
## Installation
|
|
50
84
|
|
|
51
85
|
```bash
|
|
@@ -113,29 +147,26 @@ or
|
|
|
113
147
|
python -m praisonai ui
|
|
114
148
|
```
|
|
115
149
|
|
|
116
|
-
##
|
|
150
|
+
## Praison AI Chat
|
|
117
151
|
|
|
118
|
-
|
|
152
|
+
* https://docs.praison.ai/chat/
|
|
119
153
|
|
|
120
154
|
```bash
|
|
121
|
-
pip install praisonai
|
|
155
|
+
pip install "praisonai[chat]"
|
|
122
156
|
export OPENAI_API_KEY="Enter your API key"
|
|
123
|
-
praisonai
|
|
157
|
+
praisonai chat
|
|
124
158
|
```
|
|
125
159
|
|
|
126
|
-
|
|
127
|
-
- Create a file called tools.py and add this code [tools.py](./tools.py)
|
|
160
|
+
## Create Custom Tools
|
|
128
161
|
|
|
129
|
-
|
|
130
|
-
praisonai
|
|
131
|
-
```
|
|
162
|
+
* https://docs.praison.ai/tools/custom/
|
|
132
163
|
|
|
133
|
-
### Pre-requisite to Create a Custom Tool
|
|
164
|
+
### Step 1: Pre-requisite to Create a Custom Tool
|
|
134
165
|
`agents.yaml` file should be present in the current directory.
|
|
135
166
|
|
|
136
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`.
|
|
137
168
|
|
|
138
|
-
### Step
|
|
169
|
+
### Step 2: to Create a Custom Tool
|
|
139
170
|
|
|
140
171
|
Create a file called tools.py in the same directory as the agents.yaml file.
|
|
141
172
|
|
|
@@ -154,7 +185,7 @@ class InternetSearchTool(BaseTool):
|
|
|
154
185
|
return results
|
|
155
186
|
```
|
|
156
187
|
|
|
157
|
-
### Step
|
|
188
|
+
### Step 3: to Create a Custom Tool
|
|
158
189
|
|
|
159
190
|
Add the tool to the agents.yaml file as show below under the tools section `- InternetSearchTool`.
|
|
160
191
|
|
|
@@ -175,12 +206,6 @@ roles:
|
|
|
175
206
|
- InternetSearchTool
|
|
176
207
|
```
|
|
177
208
|
|
|
178
|
-
## Test
|
|
179
|
-
|
|
180
|
-
```bash
|
|
181
|
-
python -m unittest tests.test
|
|
182
|
-
```
|
|
183
|
-
|
|
184
209
|
## Agents Playbook
|
|
185
210
|
|
|
186
211
|
### Simple Playbook Example
|
|
@@ -199,50 +224,50 @@ roles:
|
|
|
199
224
|
expected_output: 'Complete script ready for production.'
|
|
200
225
|
```
|
|
201
226
|
|
|
202
|
-
|
|
227
|
+
## Use 100+ Models
|
|
228
|
+
|
|
229
|
+
* https://docs.praison.ai/models/
|
|
230
|
+
|
|
231
|
+
## Include praisonai package in your project
|
|
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"
|
|
203
245
|
|
|
204
|
-
```yaml
|
|
205
|
-
framework: crewai
|
|
206
|
-
topic: Artificial Intelligence
|
|
207
246
|
roles:
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
goal: Generate engaging movie concepts using AI storylines
|
|
213
|
-
role: Movie Concept Creator
|
|
214
|
-
tasks:
|
|
215
|
-
movie_concept_development:
|
|
216
|
-
description: 'Develop movie concepts from AI-generated storylines, ensuring
|
|
217
|
-
they are engaging and have strong narrative arcs.'
|
|
218
|
-
expected_output: 'Well-structured movie concept document with character
|
|
219
|
-
bios, settings, and plot outlines.'
|
|
220
|
-
screenwriter:
|
|
221
|
-
backstory: 'Expert in writing engaging dialogue and script structure, able to
|
|
222
|
-
turn movie concepts into production-ready scripts.'
|
|
223
|
-
goal: Write compelling scripts based on movie concepts
|
|
224
|
-
role: Screenwriter
|
|
225
|
-
tasks:
|
|
226
|
-
scriptwriting_task:
|
|
227
|
-
description: 'Turn movie concepts into polished scripts with well-developed
|
|
228
|
-
characters, strong dialogue, and effective scene transitions.'
|
|
229
|
-
expected_output: 'Production-ready script with a beginning, middle, and
|
|
230
|
-
end, along with character development and engaging dialogues.'
|
|
231
|
-
editor:
|
|
232
|
-
backstory: 'Adept at identifying inconsistencies, improving language usage,
|
|
233
|
-
and maintaining the overall flow of the script.'
|
|
234
|
-
goal: Refine the scripts and ensure continuity of the movie storyline
|
|
235
|
-
role: Editor
|
|
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."
|
|
236
251
|
tasks:
|
|
237
|
-
|
|
238
|
-
description:
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
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
|
+
praison_ai = PraisonAI(agent_yaml=agent_yaml)
|
|
259
|
+
|
|
260
|
+
# Run PraisonAI
|
|
261
|
+
result = praison_ai.main()
|
|
262
|
+
|
|
263
|
+
# Print the result
|
|
264
|
+
print(result)
|
|
243
265
|
```
|
|
244
266
|
|
|
245
|
-
##
|
|
267
|
+
## Option 2: Using separate agents.yaml file
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
Note: Please create agents.yaml file before hand.
|
|
246
271
|
|
|
247
272
|
```python
|
|
248
273
|
from praisonai import PraisonAI
|
|
@@ -250,64 +275,12 @@ from praisonai import PraisonAI
|
|
|
250
275
|
def basic(): # Basic Mode
|
|
251
276
|
praison_ai = PraisonAI(agent_file="agents.yaml")
|
|
252
277
|
praison_ai.main()
|
|
253
|
-
|
|
254
|
-
def advanced(): # Advanced Mode with options
|
|
255
|
-
praison_ai = PraisonAI(
|
|
256
|
-
agent_file="agents.yaml",
|
|
257
|
-
framework="autogen",
|
|
258
|
-
)
|
|
259
|
-
praison_ai.main()
|
|
260
|
-
|
|
261
|
-
def auto(): # Full Automatic Mode
|
|
262
|
-
praison_ai = PraisonAI(
|
|
263
|
-
auto="Create a movie script about car in mars",
|
|
264
|
-
framework="autogen"
|
|
265
|
-
)
|
|
266
|
-
print(praison_ai.framework)
|
|
267
|
-
praison_ai.main()
|
|
268
278
|
|
|
269
279
|
if __name__ == "__main__":
|
|
270
280
|
basic()
|
|
271
|
-
advanced()
|
|
272
|
-
auto()
|
|
273
281
|
```
|
|
274
282
|
|
|
275
|
-
##
|
|
276
|
-
|
|
277
|
-
```
|
|
278
|
-
pip install "praisonai[crewai-tools]"
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
## Deploy
|
|
282
|
-
|
|
283
|
-
```bash
|
|
284
|
-
gcloud init
|
|
285
|
-
gcloud services enable run.googleapis.com
|
|
286
|
-
gcloud services enable containerregistry.googleapis.com
|
|
287
|
-
gcloud services enable cloudbuild.googleapis.com
|
|
288
|
-
|
|
289
|
-
export OPENAI_MODEL_NAME="gpt-4o"
|
|
290
|
-
export OPENAI_API_KEY="Enter your API key"
|
|
291
|
-
export OPENAI_API_BASE="https://api.openai.com/v1"
|
|
292
|
-
|
|
293
|
-
yes | gcloud auth configure-docker us-central1-docker.pkg.dev
|
|
294
|
-
gcloud artifacts repositories create praisonai-repository --repository-format=docker --location=us-central1
|
|
295
|
-
|
|
296
|
-
PROJECT_ID=$(gcloud config get-value project)
|
|
297
|
-
TAG="latest"
|
|
298
|
-
docker build --platform linux/amd64 -t gcr.io/${PROJECT_ID}/praisonai-app:${TAG} .
|
|
299
|
-
docker tag gcr.io/${PROJECT_ID}/praisonai-app:${TAG} us-central1-docker.pkg.dev/${PROJECT_ID}/praisonai-repository/praisonai-app:${TAG}
|
|
300
|
-
docker push us-central1-docker.pkg.dev/${PROJECT_ID}/praisonai-repository/praisonai-app:${TAG}
|
|
301
|
-
|
|
302
|
-
gcloud run deploy praisonai-service \
|
|
303
|
-
--image us-central1-docker.pkg.dev/${PROJECT_ID}/praisonai-repository/praisonai-app:${TAG} \
|
|
304
|
-
--platform managed \
|
|
305
|
-
--region us-central1 \
|
|
306
|
-
--allow-unauthenticated \
|
|
307
|
-
--set-env-vars OPENAI_MODEL_NAME=${OPENAI_MODEL_NAME},OPENAI_API_KEY=${OPENAI_API_KEY},OPENAI_API_BASE=${OPENAI_API_BASE}
|
|
308
|
-
```
|
|
309
|
-
|
|
310
|
-
### Commands to Install Dependencies:
|
|
283
|
+
## Commands to Install Dependencies:
|
|
311
284
|
|
|
312
285
|
1. **Install all dependencies, including dev dependencies:**
|
|
313
286
|
```sh
|
|
@@ -331,30 +304,6 @@ gcloud run deploy praisonai-service \
|
|
|
331
304
|
|
|
332
305
|
This configuration ensures that your development dependencies are correctly categorized and installed as needed.
|
|
333
306
|
|
|
334
|
-
## Other Models
|
|
335
|
-
|
|
336
|
-
```bash
|
|
337
|
-
# Ollama
|
|
338
|
-
OPENAI_API_BASE='http://localhost:11434/v1'
|
|
339
|
-
OPENAI_MODEL_NAME='mistral'
|
|
340
|
-
OPENAI_API_KEY='NA'
|
|
341
|
-
|
|
342
|
-
# FastChat
|
|
343
|
-
OPENAI_API_BASE="http://localhost:8001/v1"
|
|
344
|
-
OPENAI_MODEL_NAME='oh-2.5m7b-q51'
|
|
345
|
-
OPENAI_API_KEY=NA
|
|
346
|
-
|
|
347
|
-
# LM Studio
|
|
348
|
-
OPENAI_API_BASE="http://localhost:1234/v1"
|
|
349
|
-
OPENAI_MODEL_NAME=NA
|
|
350
|
-
OPENAI_API_KEY=NA
|
|
351
|
-
|
|
352
|
-
# Mistral API
|
|
353
|
-
OPENAI_API_BASE=https://api.mistral.ai/v1
|
|
354
|
-
OPENAI_MODEL_NAME="mistral-small"
|
|
355
|
-
OPENAI_API_KEY=your-mistral-api-key
|
|
356
|
-
```
|
|
357
|
-
|
|
358
307
|
## Contributing
|
|
359
308
|
|
|
360
309
|
- Fork on GitHub: Use the "Fork" button on the repository page.
|
|
@@ -1,7 +1,23 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="docs/images/praisonai-logo-large.png">
|
|
4
|
+
<source media="(prefers-color-scheme: light)" srcset="docs/images/praisonai-logo-black-large.png">
|
|
5
|
+
<img alt="PraisonAI Logo" src="docs/images/praisonai-logo-black-large.png">
|
|
6
|
+
</picture>
|
|
7
|
+
</p>
|
|
8
|
+
<div align="center">
|
|
9
|
+
|
|
1
10
|
# Praison AI
|
|
2
11
|
|
|
12
|
+
</div>
|
|
13
|
+
|
|
3
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.
|
|
4
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
|
+
|
|
5
21
|
## TL;DR
|
|
6
22
|
```bash
|
|
7
23
|
pip install praisonai
|
|
@@ -10,6 +26,22 @@ praisonai --init create a movie script about dog in moon
|
|
|
10
26
|
praisonai
|
|
11
27
|
```
|
|
12
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
|
+
|
|
13
45
|
## Installation
|
|
14
46
|
|
|
15
47
|
```bash
|
|
@@ -77,29 +109,26 @@ or
|
|
|
77
109
|
python -m praisonai ui
|
|
78
110
|
```
|
|
79
111
|
|
|
80
|
-
##
|
|
112
|
+
## Praison AI Chat
|
|
81
113
|
|
|
82
|
-
|
|
114
|
+
* https://docs.praison.ai/chat/
|
|
83
115
|
|
|
84
116
|
```bash
|
|
85
|
-
pip install praisonai
|
|
117
|
+
pip install "praisonai[chat]"
|
|
86
118
|
export OPENAI_API_KEY="Enter your API key"
|
|
87
|
-
praisonai
|
|
119
|
+
praisonai chat
|
|
88
120
|
```
|
|
89
121
|
|
|
90
|
-
|
|
91
|
-
- Create a file called tools.py and add this code [tools.py](./tools.py)
|
|
122
|
+
## Create Custom Tools
|
|
92
123
|
|
|
93
|
-
|
|
94
|
-
praisonai
|
|
95
|
-
```
|
|
124
|
+
* https://docs.praison.ai/tools/custom/
|
|
96
125
|
|
|
97
|
-
### Pre-requisite to Create a Custom Tool
|
|
126
|
+
### Step 1: Pre-requisite to Create a Custom Tool
|
|
98
127
|
`agents.yaml` file should be present in the current directory.
|
|
99
128
|
|
|
100
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`.
|
|
101
130
|
|
|
102
|
-
### Step
|
|
131
|
+
### Step 2: to Create a Custom Tool
|
|
103
132
|
|
|
104
133
|
Create a file called tools.py in the same directory as the agents.yaml file.
|
|
105
134
|
|
|
@@ -118,7 +147,7 @@ class InternetSearchTool(BaseTool):
|
|
|
118
147
|
return results
|
|
119
148
|
```
|
|
120
149
|
|
|
121
|
-
### Step
|
|
150
|
+
### Step 3: to Create a Custom Tool
|
|
122
151
|
|
|
123
152
|
Add the tool to the agents.yaml file as show below under the tools section `- InternetSearchTool`.
|
|
124
153
|
|
|
@@ -139,12 +168,6 @@ roles:
|
|
|
139
168
|
- InternetSearchTool
|
|
140
169
|
```
|
|
141
170
|
|
|
142
|
-
## Test
|
|
143
|
-
|
|
144
|
-
```bash
|
|
145
|
-
python -m unittest tests.test
|
|
146
|
-
```
|
|
147
|
-
|
|
148
171
|
## Agents Playbook
|
|
149
172
|
|
|
150
173
|
### Simple Playbook Example
|
|
@@ -163,50 +186,50 @@ roles:
|
|
|
163
186
|
expected_output: 'Complete script ready for production.'
|
|
164
187
|
```
|
|
165
188
|
|
|
166
|
-
|
|
189
|
+
## Use 100+ Models
|
|
190
|
+
|
|
191
|
+
* https://docs.praison.ai/models/
|
|
192
|
+
|
|
193
|
+
## Include praisonai package in your project
|
|
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"
|
|
167
207
|
|
|
168
|
-
```yaml
|
|
169
|
-
framework: crewai
|
|
170
|
-
topic: Artificial Intelligence
|
|
171
208
|
roles:
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
goal: Generate engaging movie concepts using AI storylines
|
|
177
|
-
role: Movie Concept Creator
|
|
178
|
-
tasks:
|
|
179
|
-
movie_concept_development:
|
|
180
|
-
description: 'Develop movie concepts from AI-generated storylines, ensuring
|
|
181
|
-
they are engaging and have strong narrative arcs.'
|
|
182
|
-
expected_output: 'Well-structured movie concept document with character
|
|
183
|
-
bios, settings, and plot outlines.'
|
|
184
|
-
screenwriter:
|
|
185
|
-
backstory: 'Expert in writing engaging dialogue and script structure, able to
|
|
186
|
-
turn movie concepts into production-ready scripts.'
|
|
187
|
-
goal: Write compelling scripts based on movie concepts
|
|
188
|
-
role: Screenwriter
|
|
189
|
-
tasks:
|
|
190
|
-
scriptwriting_task:
|
|
191
|
-
description: 'Turn movie concepts into polished scripts with well-developed
|
|
192
|
-
characters, strong dialogue, and effective scene transitions.'
|
|
193
|
-
expected_output: 'Production-ready script with a beginning, middle, and
|
|
194
|
-
end, along with character development and engaging dialogues.'
|
|
195
|
-
editor:
|
|
196
|
-
backstory: 'Adept at identifying inconsistencies, improving language usage,
|
|
197
|
-
and maintaining the overall flow of the script.'
|
|
198
|
-
goal: Refine the scripts and ensure continuity of the movie storyline
|
|
199
|
-
role: Editor
|
|
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."
|
|
200
213
|
tasks:
|
|
201
|
-
|
|
202
|
-
description:
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
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
|
+
praison_ai = PraisonAI(agent_yaml=agent_yaml)
|
|
221
|
+
|
|
222
|
+
# Run PraisonAI
|
|
223
|
+
result = praison_ai.main()
|
|
224
|
+
|
|
225
|
+
# Print the result
|
|
226
|
+
print(result)
|
|
207
227
|
```
|
|
208
228
|
|
|
209
|
-
##
|
|
229
|
+
## Option 2: Using separate agents.yaml file
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
Note: Please create agents.yaml file before hand.
|
|
210
233
|
|
|
211
234
|
```python
|
|
212
235
|
from praisonai import PraisonAI
|
|
@@ -214,64 +237,12 @@ from praisonai import PraisonAI
|
|
|
214
237
|
def basic(): # Basic Mode
|
|
215
238
|
praison_ai = PraisonAI(agent_file="agents.yaml")
|
|
216
239
|
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()
|
|
232
240
|
|
|
233
241
|
if __name__ == "__main__":
|
|
234
242
|
basic()
|
|
235
|
-
advanced()
|
|
236
|
-
auto()
|
|
237
243
|
```
|
|
238
244
|
|
|
239
|
-
##
|
|
240
|
-
|
|
241
|
-
```
|
|
242
|
-
pip install "praisonai[crewai-tools]"
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
## Deploy
|
|
246
|
-
|
|
247
|
-
```bash
|
|
248
|
-
gcloud init
|
|
249
|
-
gcloud services enable run.googleapis.com
|
|
250
|
-
gcloud services enable containerregistry.googleapis.com
|
|
251
|
-
gcloud services enable cloudbuild.googleapis.com
|
|
252
|
-
|
|
253
|
-
export OPENAI_MODEL_NAME="gpt-4o"
|
|
254
|
-
export OPENAI_API_KEY="Enter your API key"
|
|
255
|
-
export OPENAI_API_BASE="https://api.openai.com/v1"
|
|
256
|
-
|
|
257
|
-
yes | gcloud auth configure-docker us-central1-docker.pkg.dev
|
|
258
|
-
gcloud artifacts repositories create praisonai-repository --repository-format=docker --location=us-central1
|
|
259
|
-
|
|
260
|
-
PROJECT_ID=$(gcloud config get-value project)
|
|
261
|
-
TAG="latest"
|
|
262
|
-
docker build --platform linux/amd64 -t gcr.io/${PROJECT_ID}/praisonai-app:${TAG} .
|
|
263
|
-
docker tag gcr.io/${PROJECT_ID}/praisonai-app:${TAG} us-central1-docker.pkg.dev/${PROJECT_ID}/praisonai-repository/praisonai-app:${TAG}
|
|
264
|
-
docker push us-central1-docker.pkg.dev/${PROJECT_ID}/praisonai-repository/praisonai-app:${TAG}
|
|
265
|
-
|
|
266
|
-
gcloud run deploy praisonai-service \
|
|
267
|
-
--image us-central1-docker.pkg.dev/${PROJECT_ID}/praisonai-repository/praisonai-app:${TAG} \
|
|
268
|
-
--platform managed \
|
|
269
|
-
--region us-central1 \
|
|
270
|
-
--allow-unauthenticated \
|
|
271
|
-
--set-env-vars OPENAI_MODEL_NAME=${OPENAI_MODEL_NAME},OPENAI_API_KEY=${OPENAI_API_KEY},OPENAI_API_BASE=${OPENAI_API_BASE}
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
### Commands to Install Dependencies:
|
|
245
|
+
## Commands to Install Dependencies:
|
|
275
246
|
|
|
276
247
|
1. **Install all dependencies, including dev dependencies:**
|
|
277
248
|
```sh
|
|
@@ -295,30 +266,6 @@ gcloud run deploy praisonai-service \
|
|
|
295
266
|
|
|
296
267
|
This configuration ensures that your development dependencies are correctly categorized and installed as needed.
|
|
297
268
|
|
|
298
|
-
## Other Models
|
|
299
|
-
|
|
300
|
-
```bash
|
|
301
|
-
# Ollama
|
|
302
|
-
OPENAI_API_BASE='http://localhost:11434/v1'
|
|
303
|
-
OPENAI_MODEL_NAME='mistral'
|
|
304
|
-
OPENAI_API_KEY='NA'
|
|
305
|
-
|
|
306
|
-
# FastChat
|
|
307
|
-
OPENAI_API_BASE="http://localhost:8001/v1"
|
|
308
|
-
OPENAI_MODEL_NAME='oh-2.5m7b-q51'
|
|
309
|
-
OPENAI_API_KEY=NA
|
|
310
|
-
|
|
311
|
-
# LM Studio
|
|
312
|
-
OPENAI_API_BASE="http://localhost:1234/v1"
|
|
313
|
-
OPENAI_MODEL_NAME=NA
|
|
314
|
-
OPENAI_API_KEY=NA
|
|
315
|
-
|
|
316
|
-
# Mistral API
|
|
317
|
-
OPENAI_API_BASE=https://api.mistral.ai/v1
|
|
318
|
-
OPENAI_MODEL_NAME="mistral-small"
|
|
319
|
-
OPENAI_API_KEY=your-mistral-api-key
|
|
320
|
-
```
|
|
321
|
-
|
|
322
269
|
## Contributing
|
|
323
270
|
|
|
324
271
|
- Fork on GitHub: Use the "Fork" button on the repository page.
|
|
@@ -279,6 +279,9 @@ class AgentsGenerator:
|
|
|
279
279
|
else: # framework=crewai
|
|
280
280
|
if agentops_exists:
|
|
281
281
|
agentops.init(os.environ.get("AGENTOPS_API_KEY"), tags=["crewai"])
|
|
282
|
+
|
|
283
|
+
tasks_dict = {}
|
|
284
|
+
|
|
282
285
|
for role, details in config['roles'].items():
|
|
283
286
|
role_filled = details['role'].format(topic=topic)
|
|
284
287
|
goal_filled = details['goal'].format(topic=topic)
|
|
@@ -331,14 +334,35 @@ class AgentsGenerator:
|
|
|
331
334
|
description_filled = task_details['description'].format(topic=topic)
|
|
332
335
|
expected_output_filled = task_details['expected_output'].format(topic=topic)
|
|
333
336
|
|
|
334
|
-
task = Task(
|
|
337
|
+
task = Task(
|
|
338
|
+
description=description_filled, # Clear, concise statement of what the task entails
|
|
339
|
+
expected_output=expected_output_filled, # Detailed description of what task's completion looks like
|
|
340
|
+
agent=agent, # The agent responsible for the task
|
|
341
|
+
tools=task_details.get('tools', []), # Functions or capabilities the agent can utilize
|
|
342
|
+
async_execution=task_details.get('async_execution') if task_details.get('async_execution') is not None else False, # Execute asynchronously if set
|
|
343
|
+
context=[], ## TODO:
|
|
344
|
+
config=task_details.get('config') if task_details.get('config') is not None else {}, # Additional configuration details
|
|
345
|
+
output_json=task_details.get('output_json') if task_details.get('output_json') is not None else None, # Outputs a JSON object
|
|
346
|
+
output_pydantic=task_details.get('output_pydantic') if task_details.get('output_pydantic') is not None else None, # Outputs a Pydantic model object
|
|
347
|
+
output_file=task_details.get('output_file') if task_details.get('output_file') is not None else "", # Saves the task output to a file
|
|
348
|
+
callback=task_details.get('callback') if task_details.get('callback') is not None else None, # Python callable executed with the task's output
|
|
349
|
+
human_input=task_details.get('human_input') if task_details.get('human_input') is not None else False, # Indicates if the task requires human feedback
|
|
350
|
+
create_directory=task_details.get('create_directory') if task_details.get('create_directory') is not None else False # Indicates if a directory needs to be created
|
|
351
|
+
)
|
|
335
352
|
|
|
336
353
|
# Set tool callback if provided
|
|
337
354
|
if self.task_callback:
|
|
338
355
|
task.callback = self.task_callback
|
|
339
356
|
|
|
340
357
|
tasks.append(task)
|
|
358
|
+
tasks_dict[task_name] = task
|
|
341
359
|
|
|
360
|
+
for role, details in config['roles'].items():
|
|
361
|
+
for task_name, task_details in details.get('tasks', {}).items():
|
|
362
|
+
task = tasks_dict[task_name]
|
|
363
|
+
context_tasks = [tasks_dict[ctx] for ctx in task_details.get('context', []) if ctx in tasks_dict]
|
|
364
|
+
task.context = context_tasks
|
|
365
|
+
|
|
342
366
|
crew = Crew(
|
|
343
367
|
agents=list(agents.values()),
|
|
344
368
|
tasks=tasks,
|