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

オープン
#14,773 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

@poojithparchuri-iiitk がすでに取り組んでいます。

2026年11月18日 から。

  • #14816 @poojithparchuri-iiitk による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

.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

主要言語
C#
スター
28.8k
フォーク
4.9k
平均マージ
2日 17時間
マージ済み PR(30日)
48

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/semantic-kernel のほかの issue

microsoft/semantic-kernel の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。