From 3efea1ac537cb37219a76fab82e7b8899f9e92fe Mon Sep 17 00:00:00 2001 From: Tai An Date: Sat, 29 Aug 2026 12:25:37 -0700 Subject: [PATCH] fix(google_search): pass k when AsyncGoogleSearch parses results AsyncGoogleSearch inherits GoogleSearch._parse_results(self, results, k), but AsyncGoogleSearch.run called it with only `results`, so every HTTP 200 raised TypeError instead of returning the parsed snippets. The synchronous GoogleSearch.run already passes k; this makes the async path match. --- lagent/actions/google_search.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lagent/actions/google_search.py b/lagent/actions/google_search.py index 27b31456..f039860d 100644 --- a/lagent/actions/google_search.py +++ b/lagent/actions/google_search.py @@ -196,7 +196,7 @@ async def run(self, query: str, k: int = 10) -> ActionReturn: tool_return.errmsg = response tool_return.state = ActionStatusCode.HTTP_ERROR elif status_code == 200: - parsed_res = self._parse_results(response) + parsed_res = self._parse_results(response, k) tool_return.result = [dict(type='text', content=str(parsed_res))] tool_return.state = ActionStatusCode.SUCCESS else: