Skip to content

fix: update GoogleSearch tool parameters#2430

Closed
Shivam909058 wants to merge 1 commit intoagno-agi:mainfrom
Shivam909058:fix/google-search-params
Closed

fix: update GoogleSearch tool parameters#2430
Shivam909058 wants to merge 1 commit intoagno-agi:mainfrom
Shivam909058:fix/google-search-params

Conversation

@Shivam909058
Copy link

  • Changed num_results parameter to num to match googlesearch-python API
  • Removed advanced parameter as it's no longer supported
  • Updated documentation and type hints
  • Added better error handling

Description

  • Summary of changes: Describe the key changes in this PR and their purpose.
  • Related issues: Mention if this PR fixes or is connected to any issues.
  • Motivation and context: Explain the reason for the changes and the problem they solve.
  • Environment or dependencies: Specify any changes in dependencies or environment configurations required for this update.
  • Impact on metrics: (If applicable) Describe changes in any metrics or performance benchmarks.

Fixes # (issue)


Type of change

Please check the options that are relevant:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Model update (Addition or modification of models)
  • Other (please describe):

Checklist

  • Adherence to standards: Code complies with Agno’s style guidelines and best practices.
  • Formatting and validation: You have run ./scripts/format.sh and ./scripts/validate.sh to ensure code is formatted and linted.
  • Self-review completed: A thorough review has been performed by the contributor(s).
  • Documentation: Docstrings and comments have been added or updated for any complex logic.
  • Examples and guides: Relevant cookbook examples have been included or updated (if applicable).
  • Tested in a clean environment: Changes have been tested in a clean environment to confirm expected behavior.
  • Tests (optional): Tests have been added or updated to cover any new or changed functionality.

Additional Notes

Include any deployment notes, performance implications, security considerations, or other relevant information (e.g., screenshots or logs if applicable).

Description

Fixed compatibility issues with googlesearch-python library in the GoogleSearch tool.

Changes

  • Updated num_results parameter to num to match current googlesearch-python API
  • Removed unsupported advanced parameter
  • Added better error handling and logging
  • Updated documentation

Testing

Tested with:

  • googlesearch-python latest version
  • Sample queries using the updated parameters
  • Error handling scenarios

Related Issues

Fixes #[issue-number] (if there is one)

Dependencies

  • googlesearch-python >= 1.1.0

Breaking Changes

  • Removed support for advanced parameter
  • Changed num_results to num in method signature
  • use 'pip install googlesearch-python==1.0.1'

- Changed num_results parameter to num to match googlesearch-python API
- Removed advanced parameter as it's no longer supported
- Updated documentation and type hints
- Added better error handling
@Shivam909058 Shivam909058 requested a review from a team as a code owner March 17, 2025 05:24
@Shivam909058
Copy link
Author

fixed the isssue " #2429"

@kausmeows
Copy link
Contributor

@Shivam909058 thanks for getting this to our attention. Although the workaround seems fine but i think it'll be better long term to directly implement the suggested solution you just mentioned and support the changed api params directly via the SDK.

Your thoughts @ysolanky @dirkbrnd ?

from agno.storage.sqlite import SqliteStorage
from agno.tools.googlesearch import GoogleSearchTools
from agno.storage.workflow.sqlite import SqliteWorkflowStorage
from agno.tools.googlesearch import GoogleSearch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is incorrect

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we've merged agent and workflows storage right

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes and the tool name as well

@Shivam909058
Copy link
Author

Please provide a brief description what to change for merging
Like I didn't get it what exactly wrong in my changes
Because the main error I am facing because of proxy

So please tell me

@dirkbrnd
Copy link
Contributor

Please provide a brief description what to change for merging Like I didn't get it what exactly wrong in my changes Because the main error I am facing because of proxy

So please tell me

So your import fixes are incorrect as mentioned.
If you want to have a proxy parameter for google search tool, I suggest updating the google search tool itself. You should also then just make sure to update the tests for GoogleSearchTool.

Thanks for the contribution!

@dirkbrnd dirkbrnd closed this Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants