praisonaiagents 0.0.100__py3-none-any.whl → 0.0.101__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.
- praisonaiagents/tools/README.md +155 -0
- {praisonaiagents-0.0.100.dist-info → praisonaiagents-0.0.101.dist-info}/METADATA +2 -1
- {praisonaiagents-0.0.100.dist-info → praisonaiagents-0.0.101.dist-info}/RECORD +5 -4
- {praisonaiagents-0.0.100.dist-info → praisonaiagents-0.0.101.dist-info}/WHEEL +0 -0
- {praisonaiagents-0.0.100.dist-info → praisonaiagents-0.0.101.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,155 @@
|
|
1
|
+
# PraisonAI Tools Guide
|
2
|
+
|
3
|
+
Welcome to the PraisonAI Tools directory! This guide will help you understand how our tools work and how to create new ones, whether you're a beginner or an experienced programmer.
|
4
|
+
|
5
|
+
## What is a Tool?
|
6
|
+
|
7
|
+
A tool is a piece of code that helps our AI agents perform specific tasks. Think of tools as special abilities that we give to our agents. For example:
|
8
|
+
- An internet search tool lets agents search the web
|
9
|
+
- A stock market tool lets agents check stock prices
|
10
|
+
- A weather tool lets agents check the weather
|
11
|
+
|
12
|
+
## Creating New Tools: The Two Approaches
|
13
|
+
|
14
|
+
### 1. Function-Based Approach (Simple Tools)
|
15
|
+
|
16
|
+
Best for simple tools that do one specific thing. Like a calculator that just adds numbers.
|
17
|
+
|
18
|
+
**When to use:**
|
19
|
+
- Tool does one simple task
|
20
|
+
- Doesn't need to remember information between uses
|
21
|
+
- Doesn't need to share information with other tools
|
22
|
+
- Quick, one-time operations
|
23
|
+
|
24
|
+
**Example:**
|
25
|
+
```python
|
26
|
+
def internet_search(query: str):
|
27
|
+
# Search the internet and return results
|
28
|
+
return search_results
|
29
|
+
```
|
30
|
+
|
31
|
+
**Usage:**
|
32
|
+
```python
|
33
|
+
from praisonaiagents.tools import internet_search
|
34
|
+
|
35
|
+
results = internet_search("AI news")
|
36
|
+
```
|
37
|
+
|
38
|
+
### 2. Class-Based Approach (Complex Tools)
|
39
|
+
|
40
|
+
Best for tools that do multiple related things or need to remember information. Like a smart calculator that remembers your previous calculations and can do many different math operations.
|
41
|
+
|
42
|
+
**When to use:**
|
43
|
+
- Tool has multiple related functions
|
44
|
+
- Needs to remember or share information
|
45
|
+
- Needs to manage resources efficiently
|
46
|
+
- Has complex setup requirements
|
47
|
+
|
48
|
+
**Example:**
|
49
|
+
```python
|
50
|
+
class StockTools:
|
51
|
+
def get_stock_price(self, symbol):
|
52
|
+
# Get current stock price
|
53
|
+
return price
|
54
|
+
|
55
|
+
def get_stock_info(self, symbol):
|
56
|
+
# Get detailed stock information
|
57
|
+
return info
|
58
|
+
```
|
59
|
+
|
60
|
+
**Usage:**
|
61
|
+
```python
|
62
|
+
from praisonaiagents.tools import get_stock_price, get_stock_info
|
63
|
+
|
64
|
+
price = get_stock_price("AAPL")
|
65
|
+
info = get_stock_info("AAPL")
|
66
|
+
```
|
67
|
+
|
68
|
+
## How to Choose Your Approach
|
69
|
+
|
70
|
+
Ask yourself these questions:
|
71
|
+
|
72
|
+
1. **Is your tool doing one simple thing?**
|
73
|
+
- Yes → Use Function-Based Approach
|
74
|
+
- No → Consider Class-Based Approach
|
75
|
+
|
76
|
+
2. **Does your tool need to remember information?**
|
77
|
+
- Yes → Use Class-Based Approach
|
78
|
+
- No → Use Function-Based Approach
|
79
|
+
|
80
|
+
3. **Are your tool's operations related to each other?**
|
81
|
+
- Yes → Use Class-Based Approach
|
82
|
+
- No → Use Function-Based Approach
|
83
|
+
|
84
|
+
4. **Does your tool need to manage resources efficiently?**
|
85
|
+
- Yes → Use Class-Based Approach
|
86
|
+
- No → Use Function-Based Approach
|
87
|
+
|
88
|
+
## Real-World Examples
|
89
|
+
|
90
|
+
### Internet Search Tool (Function-Based)
|
91
|
+
- Does one thing: searches the internet
|
92
|
+
- Doesn't need to remember previous searches
|
93
|
+
- Each search is independent
|
94
|
+
- Simple input/output operation
|
95
|
+
|
96
|
+
### SearxNG Search Tool (Function-Based)
|
97
|
+
- Privacy-focused web search using local SearxNG instance
|
98
|
+
- Simple search operation with customizable parameters
|
99
|
+
- Each search is independent and secure
|
100
|
+
- Alternative to traditional search engines for privacy
|
101
|
+
|
102
|
+
### Stock Market Tool (Class-Based)
|
103
|
+
- Does multiple things: check prices, get company info, get historical data
|
104
|
+
- Remembers stock information to avoid repeated downloads
|
105
|
+
- Operations are related (all about stocks)
|
106
|
+
- Manages connections efficiently
|
107
|
+
|
108
|
+
## Getting Started
|
109
|
+
|
110
|
+
1. **Choose Your Approach** based on the guidelines above
|
111
|
+
|
112
|
+
2. **Create Your Tool File**:
|
113
|
+
- Name it descriptively (e.g., `weather_tools.py`)
|
114
|
+
- Place it in the `praisonaiagents/tools` directory
|
115
|
+
|
116
|
+
3. **Write Your Tool**:
|
117
|
+
- Add clear documentation
|
118
|
+
- Include type hints for better understanding
|
119
|
+
- Handle errors gracefully
|
120
|
+
|
121
|
+
4. **Test Your Tool**:
|
122
|
+
- Make sure it works as expected
|
123
|
+
- Test error cases
|
124
|
+
- Check performance
|
125
|
+
|
126
|
+
## Best Practices
|
127
|
+
|
128
|
+
1. **Documentation**:
|
129
|
+
- Explain what your tool does
|
130
|
+
- Provide examples
|
131
|
+
- List any requirements
|
132
|
+
|
133
|
+
2. **Error Handling**:
|
134
|
+
- Always handle possible errors
|
135
|
+
- Return helpful error messages
|
136
|
+
- Don't let your tool crash
|
137
|
+
|
138
|
+
3. **Performance**:
|
139
|
+
- Keep it efficient
|
140
|
+
- Don't waste resources
|
141
|
+
- Cache when helpful
|
142
|
+
|
143
|
+
4. **User-Friendly**:
|
144
|
+
- Make it easy to use
|
145
|
+
- Use clear function/method names
|
146
|
+
- Keep it simple
|
147
|
+
|
148
|
+
## Need Help?
|
149
|
+
|
150
|
+
- Check existing tools for examples
|
151
|
+
- Ask in our community
|
152
|
+
- Read the documentation
|
153
|
+
- Don't hesitate to ask questions!
|
154
|
+
|
155
|
+
Remember: The goal is to make tools that are easy to use and maintain. Choose the approach that makes the most sense for your specific tool's needs.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: praisonaiagents
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.101
|
4
4
|
Summary: Praison AI agents for completing complex tasks with Self Reflection Agents
|
5
5
|
Author: Mervin Praison
|
6
6
|
Requires-Python: >=3.10
|
@@ -14,6 +14,7 @@ Requires-Dist: fastapi>=0.115.0; extra == "mcp"
|
|
14
14
|
Requires-Dist: uvicorn>=0.34.0; extra == "mcp"
|
15
15
|
Provides-Extra: memory
|
16
16
|
Requires-Dist: chromadb>=1.0.0; extra == "memory"
|
17
|
+
Requires-Dist: litellm>=1.50.0; extra == "memory"
|
17
18
|
Provides-Extra: knowledge
|
18
19
|
Requires-Dist: mem0ai>=0.1.0; extra == "knowledge"
|
19
20
|
Requires-Dist: chromadb>=1.0.0; extra == "knowledge"
|
@@ -25,6 +25,7 @@ praisonaiagents/process/__init__.py,sha256=lkYbL7Hn5a0ldvJtkdH23vfIIZLIcanK-65C0
|
|
25
25
|
praisonaiagents/process/process.py,sha256=gxhMXG3s4CzaREyuwE5zxCMx2Wp_b_Wd53tDfkj8Qk8,66567
|
26
26
|
praisonaiagents/task/__init__.py,sha256=VL5hXVmyGjINb34AalxpBMl-YW9m5EDcRkMTKkSSl7c,80
|
27
27
|
praisonaiagents/task/task.py,sha256=imqJ8wzZzVyUSym2EyF2tC-vAsV1UdfI_P3YM5mqAiw,20786
|
28
|
+
praisonaiagents/tools/README.md,sha256=bIQGTSqQbC8l_UvTAnKbnh1TxrybSFGbCqxnhvDwkE4,4450
|
28
29
|
praisonaiagents/tools/__init__.py,sha256=Rrgi7_3-yLHpfBB81WUi0-wD_wb_BsukwHVdjDYAF-0,9316
|
29
30
|
praisonaiagents/tools/arxiv_tools.py,sha256=1stb31zTjLTon4jCnpZG5de9rKc9QWgC0leLegvPXWo,10528
|
30
31
|
praisonaiagents/tools/calculator_tools.py,sha256=S1xPT74Geurvjm52QMMIG29zDXVEWJmM6nmyY7yF298,9571
|
@@ -47,7 +48,7 @@ praisonaiagents/tools/xml_tools.py,sha256=iYTMBEk5l3L3ryQ1fkUnNVYK-Nnua2Kx2S0dxN
|
|
47
48
|
praisonaiagents/tools/yaml_tools.py,sha256=uogAZrhXV9O7xvspAtcTfpKSQYL2nlOTvCQXN94-G9A,14215
|
48
49
|
praisonaiagents/tools/yfinance_tools.py,sha256=s2PBj_1v7oQnOobo2fDbQBACEHl61ftG4beG6Z979ZE,8529
|
49
50
|
praisonaiagents/tools/train/data/generatecot.py,sha256=H6bNh-E2hqL5MW6kX3hqZ05g9ETKN2-kudSjiuU_SD8,19403
|
50
|
-
praisonaiagents-0.0.
|
51
|
-
praisonaiagents-0.0.
|
52
|
-
praisonaiagents-0.0.
|
53
|
-
praisonaiagents-0.0.
|
51
|
+
praisonaiagents-0.0.101.dist-info/METADATA,sha256=E7LFE0liQmrpsCnURK80ynkYPxMKuNTTSJM4YKUS57o,1503
|
52
|
+
praisonaiagents-0.0.101.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
53
|
+
praisonaiagents-0.0.101.dist-info/top_level.txt,sha256=_HsRddrJ23iDx5TTqVUVvXG2HeHBL5voshncAMDGjtA,16
|
54
|
+
praisonaiagents-0.0.101.dist-info/RECORD,,
|
File without changes
|
File without changes
|