LangChain tools for the search1api service
Project description
LangChain Search1API Tools
This package provides LangChain tools for the Search1API service, allowing easy integration of web search, news search, and web crawling capabilities into your LangChain applications.
Disclaimer: The author of this package is not affiliated, associated, authorized, endorsed by, or in any way officially connected with Search1API, or any of its subsidiaries or its affiliates. The official Search1API website can be found at https://www.search1api.com/.
Installation
You can install the package using pip:
pip install langchain_search1api
Usage
Here's an example of how to use the tools in a LangChain application:
from langchain_search1api import SearchTool, NewsTool, CrawlTool
from langchain.agents import initialize_agent, AgentType
from langchain.llms import OpenAI
# Initialize the tools
api_key = "your_api_key_here"
search_tool = SearchTool(api_key=api_key)
news_tool = NewsTool(api_key=api_key)
crawl_tool = CrawlTool(api_key=api_key)
# Initialize the language model
llm = OpenAI(temperature=0)
# Create the agent
agent = initialize_agent(
tools=[search_tool, news_tool, crawl_tool],
llm=llm,
agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
verbose=True
)
# Use the agent
result = agent.run("Search for recent news about artificial intelligence and summarize the top 3 results.")
print(result)
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langchain_search1api-0.1.0.tar.gz.
File metadata
- Download URL: langchain_search1api-0.1.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9402aff97bdf0b9cba298e2a6a5d227be371a3d1fdcc6b5467dcf8f7cfa49a2
|
|
| MD5 |
e0cc297f22fbcdd43be693174f5c7859
|
|
| BLAKE2b-256 |
5471cf8d39a199279c5ce58c9e195396bb9b90f95fdc870e4e7ee222f1894431
|
File details
Details for the file langchain_search1api-0.1.0-py3-none-any.whl.
File metadata
- Download URL: langchain_search1api-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d466a1e178aca0176e4763f52ec486df2c4a381016ea1178ab09cfe7f6da39dc
|
|
| MD5 |
900604b835717f12f70720dbb68d36bf
|
|
| BLAKE2b-256 |
9c112bcfd0c0d2af778868e07c93684eaca56edfb84bd884a5a5845f3cb10889
|