Skip to content

Commit f6e5be7

Browse files
committed
clean up
1 parent bf7baa5 commit f6e5be7

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

jigsawstack/search.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,13 @@ def search(self, params: SearchParams) -> SearchResponse:
8181

8282
body = {
8383
"byo_urls": params.get("byo_urls", []),
84+
"query": query,
85+
"ai_overview": ai_overview,
86+
"safe_search": safe_search,
87+
"spell_check": spell_check,
8488
}
85-
path = f"/web/search?query={query}&ai_overview={ai_overview}&safe_search={safe_search}&spell_check={spell_check}"
89+
90+
path = f"/web/search"
8691
resp = Request(
8792
config=self.config,
8893
path=path,
@@ -122,10 +127,22 @@ def __init__(
122127

123128
async def search(self, params: SearchParams) -> SearchResponse:
124129
path = f"/web/search"
130+
query = params["query"]
131+
ai_overview = params.get("ai_overview", "True")
132+
safe_search = params.get("safe_search", "moderate")
133+
spell_check = params.get("spell_check", "True")
134+
135+
body = {
136+
"byo_urls": params.get("byo_urls", []),
137+
"query": query,
138+
"ai_overview": ai_overview,
139+
"safe_search": safe_search,
140+
"spell_check": spell_check,
141+
}
125142
resp = await AsyncRequest(
126143
config=self.config,
127144
path=path,
128-
params=cast(Dict[Any, Any], params),
145+
params=cast(Dict[Any, Any], body),
129146
verb="POST",
130147
).perform_with_content()
131148
return resp

0 commit comments

Comments
 (0)