seltz_search_tool
langroid/agent/tools/seltz_search_tool.py
A tool to trigger a Seltz search for a given query and return the top results.
Since the tool is stateless (i.e. does not need
access to agent state), it can be enabled for any agent, without having to define a
special method inside the agent: agent.enable_message(SeltzSearchTool)
NOTE: To use this tool, you need to:
-
set the SELTZ_API_KEY environment variable in your
.envfile, e.g.SELTZ_API_KEY=your_api_key_here -
install langroid with the
seltzextra, e.g.pip install langroid[seltz]oruv pip install langroid[seltz]orpoetry add langroid[seltz]oruv add langroid[seltz](it installs theseltzpackage from pypi).
For more information, please refer to: https://seltz.ai/
SeltzSearchTool
¶
Bases: ToolMessage
handle()
¶
Conducts a search using the Seltz API based on the provided query and number of results by triggering a seltz_search.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
A formatted string containing the titles, links, and summaries of each search result, separated by two newlines. |