Skip to content

Commit 8d17508

Browse files
authored
Integration: Bump duckduckgo-search package (run-llama#13583)
1 parent 993d609 commit 8d17508

File tree

2 files changed

+14
-5
lines changed
  • llama-index-integrations/tools/llama-index-tools-duckduckgo

2 files changed

+14
-5
lines changed

llama-index-integrations/tools/llama-index-tools-duckduckgo/llama_index/tools/duckduckgo/base.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ def duckduckgo_instant_search(self, query: str) -> List[Dict]:
2828
return list(ddg.answers(query))
2929

3030
def duckduckgo_full_search(
31-
self, query: str, region: Optional[str] = None, max_results: Optional[int] = 10
31+
self,
32+
query: str,
33+
region: Optional[str] = "wt-wt",
34+
max_results: Optional[int] = 10,
3235
) -> List[Dict]:
3336
"""
3437
Make a query to DuckDuckGo search to receive a full search results.
@@ -40,5 +43,11 @@ def duckduckgo_full_search(
4043
"""
4144
from duckduckgo_search import DDGS
4245

46+
params = {
47+
"keywords": query,
48+
"region": region,
49+
"max_results": max_results,
50+
}
51+
4352
with DDGS() as ddg:
44-
return list(ddg.text(query, region=region, max_results=max_results))
53+
return list(ddg.text(**params))

llama-index-integrations/tools/llama-index-tools-duckduckgo/pyproject.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ license = "MIT"
2929
maintainers = ["leehuwuj"]
3030
name = "llama-index-tools-duckduckgo"
3131
readme = "README.md"
32-
version = "0.1.0"
32+
version = "0.1.1"
3333

3434
[tool.poetry.dependencies]
35-
python = ">=3.8.1,<3.12"
35+
python = ">=3.8.1,<4.0"
3636
llama-index = "^0.10.1"
37-
duckduckgo-search = "4.5.0"
37+
duckduckgo-search = "^6.1.0"
3838

3939
[tool.poetry.group.dev.dependencies]
4040
ipython = "8.10.0"

0 commit comments

Comments
 (0)