PraisonAI 0.0.20__tar.gz → 0.0.21__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.20
3
+ Version: 0.0.21
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
@@ -24,6 +24,14 @@ Description-Content-Type: text/markdown
24
24
 
25
25
  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.
26
26
 
27
+ ## TL;DR
28
+ ```bash
29
+ pip install praisonai
30
+ export OPENAI_API_KEY="Enter your API key"
31
+ praisonai --init create a movie script about dog in moon
32
+ praisonai
33
+ ```
34
+
27
35
  ## Installation
28
36
 
29
37
  ```bash
@@ -31,13 +39,21 @@ pip install praisonai
31
39
  ```
32
40
 
33
41
  ## Initialise
42
+
43
+ ```bash
44
+ export OPENAI_API_KEY="Enter your API key"
45
+ ```
46
+
47
+ Generate your OPENAI API KEY from here: https://platform.openai.com/api-keys
48
+
49
+ Note: You can use other providers such as Ollama, Mistral ... etc. Details are provided at the bottom.
34
50
 
35
51
  ```bash
36
52
  praisonai --init create a movie script about dog in moon
37
53
  ```
38
54
  This will automatically create agents.yaml file in the current directory.
39
55
 
40
- To initialse with a specific agent framework:
56
+ ### To initialse with a specific agent framework (Optional):
41
57
 
42
58
  ```bash
43
59
  praisonai --framework autogen --init create movie script about cat in mars
@@ -55,7 +71,7 @@ or
55
71
  python -m praisonai
56
72
  ```
57
73
 
58
- ### Specify the agent framework
74
+ ### Specify the agent framework (Optional):
59
75
 
60
76
  ```bash
61
77
  praisonai --framework autogen
@@ -67,6 +83,68 @@ praisonai --framework autogen
67
83
  praisonai --auto create a movie script about Dog in Moon
68
84
  ```
69
85
 
86
+ ## Create Custom Tools
87
+
88
+ ### TL;DR to Create a Custom Tool
89
+
90
+ ```bash
91
+ pip install praisonai duckduckgo-search
92
+ export OPENAI_API_KEY="Enter your API key"
93
+ praisonai --init research about the latest AI News and prepare a detailed report
94
+ ```
95
+
96
+ - Add `- InternetSearchTool` in the agents.yaml file in the tools section.
97
+ - Create a file called tools.py and add this code [tools.py](./tools.py)
98
+
99
+ ```bash
100
+ praisonai
101
+ ```
102
+
103
+ ### Pre-requisite to Create a Custom Tool
104
+ `agents.yaml` file should be present in the current directory.
105
+
106
+ If it doesn't exist, create it by running the command `praisonai --init research about the latest AI News and prepare a detailed report`.
107
+
108
+ ### Step 1 to Create a Custom Tool
109
+
110
+ Create a file called tools.py in the same directory as the agents.yaml file.
111
+
112
+ ```python
113
+ # example tools.py
114
+ from duckduckgo_search import DDGS
115
+ from praisonai_tools import BaseTool
116
+
117
+ class InternetSearchTool(BaseTool):
118
+ name: str = "InternetSearchTool"
119
+ description: str = "Search Internet for relevant information based on a query or latest news"
120
+
121
+ def _run(self, query: str):
122
+ ddgs = DDGS()
123
+ results = ddgs.text(keywords=query, region='wt-wt', safesearch='moderate', max_results=5)
124
+ return results
125
+ ```
126
+
127
+ ### Step 2 to Create a Custom Tool
128
+
129
+ Add the tool to the agents.yaml file as show below under the tools section `- InternetSearchTool`.
130
+
131
+ ```yaml
132
+ framework: crewai
133
+ topic: research about the latest AI News and prepare a detailed report
134
+ roles:
135
+ research_analyst:
136
+ backstory: Experienced in gathering and analyzing data related to AI news trends.
137
+ goal: Analyze AI News trends
138
+ role: Research Analyst
139
+ tasks:
140
+ gather_data:
141
+ description: Conduct in-depth research on the latest AI News trends from reputable
142
+ sources.
143
+ expected_output: Comprehensive report on current AI News trends.
144
+ tools:
145
+ - InternetSearchTool
146
+ ```
147
+
70
148
  ## Test
71
149
 
72
150
  ```bash
@@ -75,7 +153,7 @@ python -m unittest tests.test
75
153
 
76
154
  ## Agents Playbook
77
155
 
78
- ### Simple Playbook
156
+ ### Simple Playbook Example
79
157
 
80
158
  ```yaml
81
159
  framework: crewai
@@ -91,7 +169,7 @@ roles:
91
169
  expected_output: 'Complete script ready for production.'
92
170
  ```
93
171
 
94
- ### Detailed Playbook
172
+ ### Detailed Playbook Example
95
173
 
96
174
  ```yaml
97
175
  framework: crewai
@@ -191,9 +269,11 @@ gcloud run deploy praisonai-service \
191
269
  --region us-central1 \
192
270
  --allow-unauthenticated \
193
271
  --set-env-vars OPENAI_MODEL_NAME=${OPENAI_MODEL_NAME},OPENAI_API_KEY=${OPENAI_API_KEY},OPENAI_API_BASE=${OPENAI_API_BASE}
272
+ ```
194
273
 
195
274
  ## Other Models
196
275
 
276
+ ```bash
197
277
  Ollama
198
278
  OPENAI_API_BASE='http://localhost:11434/v1'
199
279
  OPENAI_MODEL_NAME='mistral'
@@ -213,6 +293,7 @@ Mistral API¶
213
293
  OPENAI_API_BASE=https://api.mistral.ai/v1
214
294
  OPENAI_MODEL_NAME="mistral-small"
215
295
  OPENAI_API_KEY=your-mistral-api-key
296
+ ```
216
297
 
217
298
  ## Contributing
218
299
 
@@ -223,4 +304,3 @@ OPENAI_API_KEY=your-mistral-api-key
223
304
  - Push to your fork: `git push origin new-feature`
224
305
  - Submit a pull request via GitHub's web interface.
225
306
  - Await feedback from project maintainers.
226
-
@@ -2,6 +2,14 @@
2
2
 
3
3
  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
4
 
5
+ ## TL;DR
6
+ ```bash
7
+ pip install praisonai
8
+ export OPENAI_API_KEY="Enter your API key"
9
+ praisonai --init create a movie script about dog in moon
10
+ praisonai
11
+ ```
12
+
5
13
  ## Installation
6
14
 
7
15
  ```bash
@@ -9,13 +17,21 @@ pip install praisonai
9
17
  ```
10
18
 
11
19
  ## Initialise
20
+
21
+ ```bash
22
+ export OPENAI_API_KEY="Enter your API key"
23
+ ```
24
+
25
+ Generate your OPENAI API KEY from here: https://platform.openai.com/api-keys
26
+
27
+ Note: You can use other providers such as Ollama, Mistral ... etc. Details are provided at the bottom.
12
28
 
13
29
  ```bash
14
30
  praisonai --init create a movie script about dog in moon
15
31
  ```
16
32
  This will automatically create agents.yaml file in the current directory.
17
33
 
18
- To initialse with a specific agent framework:
34
+ ### To initialse with a specific agent framework (Optional):
19
35
 
20
36
  ```bash
21
37
  praisonai --framework autogen --init create movie script about cat in mars
@@ -33,7 +49,7 @@ or
33
49
  python -m praisonai
34
50
  ```
35
51
 
36
- ### Specify the agent framework
52
+ ### Specify the agent framework (Optional):
37
53
 
38
54
  ```bash
39
55
  praisonai --framework autogen
@@ -45,6 +61,68 @@ praisonai --framework autogen
45
61
  praisonai --auto create a movie script about Dog in Moon
46
62
  ```
47
63
 
64
+ ## Create Custom Tools
65
+
66
+ ### TL;DR to Create a Custom Tool
67
+
68
+ ```bash
69
+ pip install praisonai duckduckgo-search
70
+ export OPENAI_API_KEY="Enter your API key"
71
+ praisonai --init research about the latest AI News and prepare a detailed report
72
+ ```
73
+
74
+ - Add `- InternetSearchTool` in the agents.yaml file in the tools section.
75
+ - Create a file called tools.py and add this code [tools.py](./tools.py)
76
+
77
+ ```bash
78
+ praisonai
79
+ ```
80
+
81
+ ### Pre-requisite to Create a Custom Tool
82
+ `agents.yaml` file should be present in the current directory.
83
+
84
+ If it doesn't exist, create it by running the command `praisonai --init research about the latest AI News and prepare a detailed report`.
85
+
86
+ ### Step 1 to Create a Custom Tool
87
+
88
+ Create a file called tools.py in the same directory as the agents.yaml file.
89
+
90
+ ```python
91
+ # example tools.py
92
+ from duckduckgo_search import DDGS
93
+ from praisonai_tools import BaseTool
94
+
95
+ class InternetSearchTool(BaseTool):
96
+ name: str = "InternetSearchTool"
97
+ description: str = "Search Internet for relevant information based on a query or latest news"
98
+
99
+ def _run(self, query: str):
100
+ ddgs = DDGS()
101
+ results = ddgs.text(keywords=query, region='wt-wt', safesearch='moderate', max_results=5)
102
+ return results
103
+ ```
104
+
105
+ ### Step 2 to Create a Custom Tool
106
+
107
+ Add the tool to the agents.yaml file as show below under the tools section `- InternetSearchTool`.
108
+
109
+ ```yaml
110
+ framework: crewai
111
+ topic: research about the latest AI News and prepare a detailed report
112
+ roles:
113
+ research_analyst:
114
+ backstory: Experienced in gathering and analyzing data related to AI news trends.
115
+ goal: Analyze AI News trends
116
+ role: Research Analyst
117
+ tasks:
118
+ gather_data:
119
+ description: Conduct in-depth research on the latest AI News trends from reputable
120
+ sources.
121
+ expected_output: Comprehensive report on current AI News trends.
122
+ tools:
123
+ - InternetSearchTool
124
+ ```
125
+
48
126
  ## Test
49
127
 
50
128
  ```bash
@@ -53,7 +131,7 @@ python -m unittest tests.test
53
131
 
54
132
  ## Agents Playbook
55
133
 
56
- ### Simple Playbook
134
+ ### Simple Playbook Example
57
135
 
58
136
  ```yaml
59
137
  framework: crewai
@@ -69,7 +147,7 @@ roles:
69
147
  expected_output: 'Complete script ready for production.'
70
148
  ```
71
149
 
72
- ### Detailed Playbook
150
+ ### Detailed Playbook Example
73
151
 
74
152
  ```yaml
75
153
  framework: crewai
@@ -169,9 +247,11 @@ gcloud run deploy praisonai-service \
169
247
  --region us-central1 \
170
248
  --allow-unauthenticated \
171
249
  --set-env-vars OPENAI_MODEL_NAME=${OPENAI_MODEL_NAME},OPENAI_API_KEY=${OPENAI_API_KEY},OPENAI_API_BASE=${OPENAI_API_BASE}
250
+ ```
172
251
 
173
252
  ## Other Models
174
253
 
254
+ ```bash
175
255
  Ollama
176
256
  OPENAI_API_BASE='http://localhost:11434/v1'
177
257
  OPENAI_MODEL_NAME='mistral'
@@ -191,6 +271,7 @@ Mistral API¶
191
271
  OPENAI_API_BASE=https://api.mistral.ai/v1
192
272
  OPENAI_MODEL_NAME="mistral-small"
193
273
  OPENAI_API_KEY=your-mistral-api-key
274
+ ```
194
275
 
195
276
  ## Contributing
196
277
 
@@ -200,4 +281,4 @@ OPENAI_API_KEY=your-mistral-api-key
200
281
  - Make changes and commit: `git commit -am "Add some feature"`
201
282
  - Push to your fork: `git push origin new-feature`
202
283
  - Submit a pull request via GitHub's web interface.
203
- - Await feedback from project maintainers.
284
+ - Await feedback from project maintainers.
@@ -43,7 +43,7 @@ class AgentsGenerator:
43
43
  spec = importlib.util.spec_from_file_location("tools_module", module_path)
44
44
  module = importlib.util.module_from_spec(spec)
45
45
  spec.loader.exec_module(module)
46
- return {name: obj() for name, obj in inspect.getmembers(module, lambda x: inspect.isclass(x) and issubclass(x, BaseTool) and x is not BaseTool)}
46
+ return {name: obj() for name, obj in inspect.getmembers(module, lambda x: inspect.isclass(x) and (x.__module__.startswith('langchain_community.tools') or issubclass(x, BaseTool)) and x is not BaseTool)}
47
47
 
48
48
  def load_tools_from_package(self, package_path):
49
49
  tools_dict = {}
@@ -13,7 +13,7 @@ class CloudDeployer:
13
13
  file.write("FROM python:3.11-slim\n")
14
14
  file.write("WORKDIR /app\n")
15
15
  file.write("COPY . .\n")
16
- file.write("RUN pip install flask praisonai==0.0.20 gunicorn markdown\n")
16
+ file.write("RUN pip install flask praisonai==0.0.21 gunicorn markdown\n")
17
17
  file.write("EXPOSE 8080\n")
18
18
  file.write('CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]\n')
19
19
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "praisonAI"
3
- version = "0.0.20"
3
+ version = "0.0.21"
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
File without changes