Open dsnetgo opened 12 hours ago
I found a similar unsolved discussion titled Google Search Api not Working and a closed issue titled Google search tool just return one search result. The closed issue suggests a solution related to the _process_response
method in the SerpAPI
class. The issue was that the method only returned the first result when the result type was "text". The suggested fix involves modifying the method to aggregate multiple results into a single string or a list. Here's an example modification:
elif "organic_results" in res.keys() and len(res["organic_results"]) > 0:
snippets = [result["snippet"] for result in res["organic_results"] if "snippet" in result.keys()]
toret = "\n".join(snippets)
This change collects the "snippet" from each result and joins them into a single string separated by newlines. You might want to check if this solution applies to your case and adjust your code accordingly [1][2].
To continue talking to Dosu, mention @dosu.
Self Checks
Dify version
11.0
Cloud or Self Hosted
Cloud, Self Hosted (Docker), Self Hosted (Source)
Steps to reproduce
Hi. Google Search Api not Working.
Can you fix this? On version 9.2 everything works. It doesn't work on version 10.x, 11.x
✔️ Expected Behavior
No response
❌ Actual Behavior
No response