Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python: removed old search plugins #11035

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions python/samples/concepts/README.md
Original file line number Diff line number Diff line change
@@ -172,10 +172,7 @@

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

- [Bing Search Plugin](./search/bing_search_plugin.py)
- [Bing Text Search](./search/bing_text_search.py)
- [Bing Text Search as Plugin](./search/bing_text_search_as_plugin.py)
- [Google Search Plugin](./search/google_search_plugin.py)
- [Google Text Search as Plugin](./search/google_text_search_as_plugin.py)

### Service Selector - Shows how to create and use a custom service selector class
121 changes: 0 additions & 121 deletions python/samples/concepts/search/bing_plugin_examples.py

This file was deleted.

69 changes: 0 additions & 69 deletions python/samples/concepts/search/bing_search_plugin.py

This file was deleted.

48 changes: 0 additions & 48 deletions python/samples/concepts/search/bing_text_search.py

This file was deleted.

13 changes: 6 additions & 7 deletions python/samples/concepts/search/bing_text_search_as_plugin.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
# Copyright (c) Microsoft. All rights reserved.


from collections.abc import Coroutine
from typing import Any
from collections.abc import Awaitable, Callable

from semantic_kernel import Kernel
from semantic_kernel.connectors.ai.function_choice_behavior import FunctionChoiceBehavior
from semantic_kernel.connectors.ai import FunctionChoiceBehavior
from semantic_kernel.connectors.ai.open_ai import (
OpenAIChatCompletion,
OpenAIChatPromptExecutionSettings,
)
from semantic_kernel.connectors.search.bing import BingSearch
from semantic_kernel.contents import ChatHistory
from semantic_kernel.filters.filter_types import FilterTypes
from semantic_kernel.filters.functions.function_invocation_context import FunctionInvocationContext
from semantic_kernel.filters import FilterTypes, FunctionInvocationContext
from semantic_kernel.functions import KernelArguments, KernelParameterMetadata, KernelPlugin

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


@kernel.filter(filter_type=FilterTypes.FUNCTION_INVOCATION)
async def log_bing_filter(context: FunctionInvocationContext, next: Coroutine[FunctionInvocationContext, Any, None]):
async def log_bing_filter(
context: FunctionInvocationContext, next: Callable[[FunctionInvocationContext], Awaitable[None]]
):
if context.function.plugin_name == "bing":
print("Calling Bing search with arguments:")
if "query" in context.arguments:
92 changes: 0 additions & 92 deletions python/samples/concepts/search/google_search_plugin.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -5,15 +5,14 @@
from typing import Any

from semantic_kernel import Kernel
from semantic_kernel.connectors.ai.function_choice_behavior import FunctionChoiceBehavior
from semantic_kernel.connectors.ai import FunctionChoiceBehavior
from semantic_kernel.connectors.ai.open_ai import (
OpenAIChatCompletion,
OpenAIChatPromptExecutionSettings,
)
from semantic_kernel.connectors.search.google import GoogleSearch
from semantic_kernel.contents import ChatHistory
from semantic_kernel.filters.filter_types import FilterTypes
from semantic_kernel.filters.functions.function_invocation_context import FunctionInvocationContext
from semantic_kernel.filters import FilterTypes, FunctionInvocationContext
from semantic_kernel.functions import KernelArguments, KernelParameterMetadata, KernelPlugin

# This sample shows how to setup Google Search as a plugin in the Semantic Kernel.
7 changes: 0 additions & 7 deletions python/tests/samples/test_concepts.py
Original file line number Diff line number Diff line change
@@ -46,7 +46,6 @@
from samples.concepts.prompt_templates.load_yaml_prompt import main as load_yaml_prompt
from samples.concepts.prompt_templates.template_language import main as template_language
from samples.concepts.rag.rag_with_text_memory_plugin import main as rag_with_text_memory_plugin
from samples.concepts.search.bing_search_plugin import main as bing_search_plugin
from samples.concepts.service_selector.custom_service_selector import main as custom_service_selector
from samples.concepts.text_completion.text_completion import main as text_completion
from samples.getting_started_with_agents.chat_completion.step1_chat_completion_agent_simple import (
@@ -249,12 +248,6 @@
marks=pytest.mark.skipif(os.getenv(MEMORY_CONCEPT_SAMPLE, None) is None, reason="Not running memory samples."),
),
param(rag_with_text_memory_plugin, [], id="rag_with_text_memory_plugin"),
param(
bing_search_plugin,
[],
id="bing_search_plugin",
marks=pytest.mark.skip(reason="Flaky test due to Azure OpenAI content policy"),
),
param(
custom_service_selector,
[],
Loading