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

Đang mở
#14,773 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

@poojithparchuri-iiitk đang làm issue này rồi.

Từ ngày 18/11/2026.

  • #14816 của @poojithparchuri-iiitk — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
68/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

.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

Ngôn ngữ chính
C#
Star
28.8k
Fork
4.9k
Merge trung bình
2 ngày 17 giờ
Pull request đã merge (30 ngày)
48

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/semantic-kernel

Tất cả issue của microsoft/semantic-kernel

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.