Skip to content

Commit 00afbdf

Browse files
authoredMar 20, 2025
Python: removed old search plugins (microsoft#11035)
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> Removed some of the old search samples. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄
1 parent ec89fe4 commit 00afbdf

8 files changed

+8
-350
lines changed
 

‎python/samples/concepts/README.md

-3
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,7 @@
172172

173173
### Search - Using [`Search`](https://github.com/microsoft/semantic-kernel/tree/main/python/semantic_kernel/connectors/search) services information
174174

175-
- [Bing Search Plugin](./search/bing_search_plugin.py)
176-
- [Bing Text Search](./search/bing_text_search.py)
177175
- [Bing Text Search as Plugin](./search/bing_text_search_as_plugin.py)
178-
- [Google Search Plugin](./search/google_search_plugin.py)
179176
- [Google Text Search as Plugin](./search/google_text_search_as_plugin.py)
180177

181178
### Service Selector - Shows how to create and use a custom service selector class

‎python/samples/concepts/search/bing_plugin_examples.py

-121
This file was deleted.

‎python/samples/concepts/search/bing_search_plugin.py

-69
This file was deleted.

‎python/samples/concepts/search/bing_text_search.py

-48
This file was deleted.

‎python/samples/concepts/search/bing_text_search_as_plugin.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
# Copyright (c) Microsoft. All rights reserved.
22

3-
4-
from collections.abc import Coroutine
5-
from typing import Any
3+
from collections.abc import Awaitable, Callable
64

75
from semantic_kernel import Kernel
8-
from semantic_kernel.connectors.ai.function_choice_behavior import FunctionChoiceBehavior
6+
from semantic_kernel.connectors.ai import FunctionChoiceBehavior
97
from semantic_kernel.connectors.ai.open_ai import (
108
OpenAIChatCompletion,
119
OpenAIChatPromptExecutionSettings,
1210
)
1311
from semantic_kernel.connectors.search.bing import BingSearch
1412
from semantic_kernel.contents import ChatHistory
15-
from semantic_kernel.filters.filter_types import FilterTypes
16-
from semantic_kernel.filters.functions.function_invocation_context import FunctionInvocationContext
13+
from semantic_kernel.filters import FilterTypes, FunctionInvocationContext
1714
from semantic_kernel.functions import KernelArguments, KernelParameterMetadata, KernelPlugin
1815

1916
kernel = Kernel()
@@ -84,7 +81,9 @@
8481

8582

8683
@kernel.filter(filter_type=FilterTypes.FUNCTION_INVOCATION)
87-
async def log_bing_filter(context: FunctionInvocationContext, next: Coroutine[FunctionInvocationContext, Any, None]):
84+
async def log_bing_filter(
85+
context: FunctionInvocationContext, next: Callable[[FunctionInvocationContext], Awaitable[None]]
86+
):
8887
if context.function.plugin_name == "bing":
8988
print("Calling Bing search with arguments:")
9089
if "query" in context.arguments:

‎python/samples/concepts/search/google_search_plugin.py

-92
This file was deleted.

‎python/samples/concepts/search/google_text_search_as_plugin.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@
55
from typing import Any
66

77
from semantic_kernel import Kernel
8-
from semantic_kernel.connectors.ai.function_choice_behavior import FunctionChoiceBehavior
8+
from semantic_kernel.connectors.ai import FunctionChoiceBehavior
99
from semantic_kernel.connectors.ai.open_ai import (
1010
OpenAIChatCompletion,
1111
OpenAIChatPromptExecutionSettings,
1212
)
1313
from semantic_kernel.connectors.search.google import GoogleSearch
1414
from semantic_kernel.contents import ChatHistory
15-
from semantic_kernel.filters.filter_types import FilterTypes
16-
from semantic_kernel.filters.functions.function_invocation_context import FunctionInvocationContext
15+
from semantic_kernel.filters import FilterTypes, FunctionInvocationContext
1716
from semantic_kernel.functions import KernelArguments, KernelParameterMetadata, KernelPlugin
1817

1918
# This sample shows how to setup Google Search as a plugin in the Semantic Kernel.

‎python/tests/samples/test_concepts.py

-7
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
from samples.concepts.prompt_templates.load_yaml_prompt import main as load_yaml_prompt
4747
from samples.concepts.prompt_templates.template_language import main as template_language
4848
from samples.concepts.rag.rag_with_text_memory_plugin import main as rag_with_text_memory_plugin
49-
from samples.concepts.search.bing_search_plugin import main as bing_search_plugin
5049
from samples.concepts.service_selector.custom_service_selector import main as custom_service_selector
5150
from samples.concepts.text_completion.text_completion import main as text_completion
5251
from samples.getting_started_with_agents.chat_completion.step1_chat_completion_agent_simple import (
@@ -249,12 +248,6 @@
249248
marks=pytest.mark.skipif(os.getenv(MEMORY_CONCEPT_SAMPLE, None) is None, reason="Not running memory samples."),
250249
),
251250
param(rag_with_text_memory_plugin, [], id="rag_with_text_memory_plugin"),
252-
param(
253-
bing_search_plugin,
254-
[],
255-
id="bing_search_plugin",
256-
marks=pytest.mark.skip(reason="Flaky test due to Azure OpenAI content policy"),
257-
),
258251
param(
259252
custom_service_selector,
260253
[],

0 commit comments

Comments
 (0)
Please sign in to comment.