Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Search Api not Working #10325

Closed
5 tasks done
dsnetgo opened this issue Nov 5, 2024 · 1 comment
Closed
5 tasks done

Google Search Api not Working #10325

dsnetgo opened this issue Nov 5, 2024 · 1 comment
Labels
🐞 bug Something isn't working 🤔 cant-reproduce We can not reproduce it or the information is limited 🔨 feat:tools Tools for agent, function call related stuff. stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed

Comments

@dsnetgo
Copy link

dsnetgo commented Nov 5, 2024

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

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

bcbc

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

Copy link

dosubot bot commented Nov 5, 2024

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.

@dosubot dosubot bot added the 🐞 bug Something isn't working label Nov 5, 2024
@crazywoola crazywoola added the 🔨 feat:tools Tools for agent, function call related stuff. label Nov 6, 2024
@dosubot dosubot bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Dec 7, 2024
@crazywoola crazywoola added the 🤔 cant-reproduce We can not reproduce it or the information is limited label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 🤔 cant-reproduce We can not reproduce it or the information is limited 🔨 feat:tools Tools for agent, function call related stuff. stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed
Projects
None yet
Development

No branches or pull requests

2 participants