Skip to content

fix: add warning when Google search results capped at 10#2474

Open
jaffarkeikei wants to merge 2 commits intoaden-hive:mainfrom
jaffarkeikei:fix/issue-2102-web-search-google-cap
Open

fix: add warning when Google search results capped at 10#2474
jaffarkeikei wants to merge 2 commits intoaden-hive:mainfrom
jaffarkeikei:fix/issue-2102-web-search-google-cap

Conversation

@jaffarkeikei
Copy link
Copy Markdown

Closes #2102

Summary

Adds a warning to the response when Google search API caps results at 10.

Changes

  • Added warning field to result when num_results > 10
  • Warning message: "Google API limited results to 10 (requested {num_results})"

Why?

Google Custom Search API has a hard limit of 10 results per request. Previously, requests for more results were silently capped without informing the user.

Example

result = web_search(query="test", num_results=15, provider="google")
# Returns: {
#   "query": "test",
#   "results": [...],  # 10 items
#   "total": 10,
#   "provider": "google",
#   "warning": "Google API limited results to 10 (requested 15)"
# }

Testing

✅ Requests ≤10: No warning
✅ Requests >10: Warning added to response

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.

[Bug]: web_search Google provider silently caps results at 10

1 participant