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

未关闭
#14,773 0 条评论 0 个 reaction 已指派 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 小时
30 天内合并 PR
48

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/semantic-kernel 的其他 Issue

查看 microsoft/semantic-kernel 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。