@@ -66,14 +66,32 @@ Called automatically on first use. Can be called explicitly to avoid cold-start
6666#### run
6767
6868``` python
69- run(query: str ) -> dict[str , list[Document] | list[str ]]
69+ run(
70+ query: str ,
71+ top_k: int | None = None ,
72+ * ,
73+ backend: str | None = None ,
74+ region: str | None = None ,
75+ safesearch: str | None = None ,
76+ search_params: dict[str , Any] | None = None
77+ ) -> dict[str , list[Document] | list[str ]]
7078```
7179
7280Use ddgs to search the web.
7381
7482** Parameters:**
7583
7684- ** query** (<code >str</code >) – Search query.
85+ - ** top_k** (<code >int | None</code >) – Optional per-run override of the maximum number of results. If not provided, the
86+ init-time ` top_k ` is used.
87+ - ** backend** (<code >str | None</code >) – Optional per-run override of the ddgs backends. If not provided, the init-time
88+ ` backend ` is used.
89+ - ** region** (<code >str | None</code >) – Optional per-run override of the region/locale. If not provided, the init-time
90+ ` region ` is used.
91+ - ** safesearch** (<code >str | None</code >) – Optional per-run override of the safe-search level. If not provided, the init-time
92+ ` safesearch ` is used.
93+ - ** search_params** (<code >dict\[ str, Any\] | None</code >) – Optional per-run override of the extra ` DDGS().text() ` arguments. If provided, fully
94+ replaces the init-time ` search_params ` .
7795
7896** Returns:**
7997
@@ -84,7 +102,15 @@ Use ddgs to search the web.
84102#### run_async
85103
86104``` python
87- run_async(query: str ) -> dict[str , list[Document] | list[str ]]
105+ run_async(
106+ query: str ,
107+ top_k: int | None = None ,
108+ * ,
109+ backend: str | None = None ,
110+ region: str | None = None ,
111+ safesearch: str | None = None ,
112+ search_params: dict[str , Any] | None = None
113+ ) -> dict[str , list[Document] | list[str ]]
88114```
89115
90116Asynchronously use ddgs to search the web.
@@ -95,6 +121,16 @@ and return values as :meth:`run`.
95121** Parameters:**
96122
97123- ** query** (<code >str</code >) – Search query.
124+ - ** top_k** (<code >int | None</code >) – Optional per-run override of the maximum number of results. If not provided, the
125+ init-time ` top_k ` is used.
126+ - ** backend** (<code >str | None</code >) – Optional per-run override of the ddgs backends. If not provided, the init-time
127+ ` backend ` is used.
128+ - ** region** (<code >str | None</code >) – Optional per-run override of the region/locale. If not provided, the init-time
129+ ` region ` is used.
130+ - ** safesearch** (<code >str | None</code >) – Optional per-run override of the safe-search level. If not provided, the init-time
131+ ` safesearch ` is used.
132+ - ** search_params** (<code >dict\[ str, Any\] | None</code >) – Optional per-run override of the extra ` DDGS().text() ` arguments. If provided, fully
133+ replaces the init-time ` search_params ` .
98134
99135** Returns:**
100136
0 commit comments