mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-04 20:46:45 +00:00
searx: implement async + helper tool providing json results (#2129)
- implemented `arun` and `aresults`. Reuses aiosession if available. - helper tools `SearxSearchRun` and `SearxSearchResults` - update doc Co-authored-by: blob42 <spike@w530>
This commit is contained in:
@@ -47,12 +47,24 @@ s.run("what is a large language model?")
|
||||
|
||||
### Tool
|
||||
|
||||
You can also easily load this wrapper as a Tool (to use with an Agent).
|
||||
You can also load this wrapper as a Tool (to use with an Agent).
|
||||
|
||||
You can do this with:
|
||||
|
||||
```python
|
||||
from langchain.agents import load_tools
|
||||
tools = load_tools(["searx-search"], searx_host="http://localhost:8888")
|
||||
tools = load_tools(["searx-search"],
|
||||
searx_host="http://localhost:8888",
|
||||
engines=["github"])
|
||||
```
|
||||
|
||||
Note that we could _optionally_ pass custom engines to use.
|
||||
|
||||
If you want to obtain results with metadata as *json* you can use:
|
||||
```python
|
||||
tools = load_tools(["searx-search-results-json"],
|
||||
searx_host="http://localhost:8888",
|
||||
num_results=5)
|
||||
```
|
||||
|
||||
For more information on tools, see [this page](../modules/agents/tools/getting_started.md)
|
||||
|
Reference in New Issue
Block a user