Python: New Feature: Python: allow a custom endpoint for the Google text search connector

Open
#14,773 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

@poojithparchuri-iiitk is already working on this.

Since Nov 18, 2026.

  • #14816 by @poojithparchuri-iiitk — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend

Research direction

Read python/semantic_kernel/connectors/google_search.py, especially CUSTOM_SEARCH_URL, GoogleSearchSettings, and GoogleSearch.__init__; then inspect the request construction and nearby connector tests. Add an optional configurable endpoint with the existing URL as the default, and verify that a custom host is used while default behavior remains unchanged.

Written by the indexing model from the issue text.

Description

.NET python triage

The Python GoogleSearch connector always calls the URL fixed in CUSTOM_SEARCH_URL (python/semantic_kernel/connectors/google_search.py line 35) and builds every request from it (line 264). GoogleSearchSettings (line 126) holds only api_key and engine_id, so there is no way to send the same request to another host.

Google's Custom Search JSON API overview says the API is closed to new customers and that existing customers "have until January 1, 2027 to transition to an alternative solution". Teams on this connector will need to change where it points.

Proposal:

  • an optional base_url argument on GoogleSearch.__init__, beside api_key and search_engine_id
  • a matching base_url field on GoogleSearchSettings (GOOGLE_SEARCH_BASE_URL)
  • default CUSTOM_SEARCH_URL, so current behavior does not change

.NET can do this today: GoogleTextSearch takes a BaseClientService.Initializer (dotnet/src/Plugins/Plugins.Web/Google/GoogleTextSearch.cs line 46), whose BaseUri reaches CustomSearchAPIService at line 54. Bing follows the same pattern with options?.Endpoint ?? new Uri(DefaultUri) (dotnet/src/Plugins/Plugins.Web/Bing/BingTextSearch.cs line 38). If you want the shortcut in .NET as well, I can add GoogleTextSearchOptions.Endpoint mapped to Initializer.BaseUri.

We run SpecStream, a search API that serves the Custom Search request format, which is how we noticed.

Happy to send the PR with unit tests once you agree on the shape.

Tarek

Dominant language
C#
Stars
28.8k
Forks
4.9k
Avg merge
2d 17h
Merged PRs (30d)
48

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/semantic-kernel

All issues in microsoft/semantic-kernel

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.