Skip to content

Commit 5ba7110

Browse files
committed
Add search api usage in tools documentation
1 parent 08ad19b commit 5ba7110

File tree

2 files changed

+35
-7
lines changed

2 files changed

+35
-7
lines changed

dev/Readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
```bash
4141
export AZURE_OPENAI_API_KEY="<your key>" # required AZURE OPENAI USAGE
4242
export SERPER_API_KEY="<your key>" # required for Google Serper API
43+
export SEARCHAPI_API_KEY="<your key>" # required to perform web searaches on any search engines.
4344
python usecases/ProfAgent.py
4445
```
4546

docs/components/action/tools.md

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,34 @@ admin = Admin(
2525
)
2626
```
2727

28-
### 2. Serper Search Tool
28+
### 2. SearchApi Search
29+
30+
SearchApi is SERP a solution to get real-time search results into strucuted JSON response from various search engines. [SearchApi](https://searchapi.io/) supports all the major engines like Google, Bing, Baidu, etc.
31+
32+
#### Setup API
33+
34+
```python
35+
import os
36+
37+
os.environ['SEARCHAPI_API_KEY'] = "<replace-with-your-api-key>"
38+
```
39+
40+
Get your API key by creating an account or logging into your account on [SearchApi](https://searchapi.io/).
41+
42+
```python
43+
from openagi.actions.tools.serper_search import SearchApiSearch
44+
from openagi.agent import Admin
45+
from openagi.llms.openai import OpenAIModel
46+
from openagi.planner.task_decomposer import TaskPlanner
47+
48+
admin = Admin(
49+
llm = llm,
50+
actions=[SearchApiSearch],
51+
planner=TaskPlanner(),
52+
)
53+
```
54+
55+
### 3. Serper Search Tool
2956

3057
Serper is a low-cost Google Search API that can be used to add answer box, knowledge graph, and organic results data from Google Search. This tool is mainly helps user to query the Google results with less throughput and latency.&#x20;
3158

@@ -52,7 +79,7 @@ admin = Admin(
5279
)
5380
```
5481

55-
### 3. Google Serp API Search
82+
### 4. Google Serp API Search
5683

5784
Serp API is yet another solution to integrate search data. SERP stands for _Search Engine Results Page_. It refers to the page displayed by a search engine in response to a user's query.
5885

@@ -79,7 +106,7 @@ admin = Admin(
79106
)
80107
```
81108

82-
### 4. Github Search Tool
109+
### 5. Github Search Tool
83110

84111
The Github SearchTool is used for retrieving information from Github repositories using natural language queries. This tool provides functionality for querying Github repositories for various information, such as code changes, commits, active pull requests, issues, etc., using natural language input. It is designed to be used as part of a larger AI-driven agent system.
85112

@@ -106,7 +133,7 @@ admin = Admin(
106133
)
107134
```
108135

109-
### 5. YouTube Search Tool
136+
### 6. YouTube Search Tool
110137

111138
The YouTube Search tool allows users to search for videos on YouTube using natural language queries. This tool retrieves relevant video content based on user-defined search parameters, making it easier to find specific videos or topics of interest.
112139

@@ -132,7 +159,7 @@ admin = Admin(
132159
)
133160
```
134161

135-
### 6. Tavily QA Search Tool
162+
### 7. Tavily QA Search Tool
136163

137164
The Tavily QA Search tool is designed to provide answers to user queries by fetching data from various online sources. This tool enhances the capability of the agent to retrieve precise information and answer questions effectively.
138165

@@ -166,7 +193,7 @@ admin = Admin(
166193
)
167194
```
168195

169-
### 7. Exa Search Tool
196+
### 8. Exa Search Tool
170197

171198
The Exa Search tool allows users to query the Exa API to retrieve relevant responses based on user-defined questions. This tool is particularly useful for extracting information and insights from various data sources using natural language queries.
172199

@@ -202,7 +229,7 @@ admin = Admin(
202229
)
203230
```
204231

205-
### 8. Unstructured PDF Loader Tool
232+
### 9. Unstructured PDF Loader Tool
206233

207234
The Unstructured PDF Loader tool is designed to extract content, including metadata, from PDF files. It utilizes the Unstructured library to partition the PDF and chunk the content based on titles. This tool is useful for processing large volumes of PDF documents and making their contents accessible for further analysis.
208235

0 commit comments

Comments
 (0)