Skip to content

Adding a sample which showcases how to use a single client/plugin but for different sources eg. azure ai search on two different index#13

Merged
lsiddiquee merged 1 commit into
mainfrom
feature/sample-azure-search
Jun 26, 2025
Merged

Adding a sample which showcases how to use a single client/plugin but for different sources eg. azure ai search on two different index#13
lsiddiquee merged 1 commit into
mainfrom
feature/sample-azure-search

Conversation

@lsiddiquee

Copy link
Copy Markdown
Owner

Adding a sample which showcases how to use a single client/plugin but for different sources eg. azure ai search on two different index

… for different sources eg. azure ai search on two different index. Updated the readme of the samples.
@lsiddiquee lsiddiquee requested a review from Copilot June 26, 2025 08:34
@lsiddiquee lsiddiquee merged commit 86b7fee into main Jun 26, 2025
2 checks passed
@lsiddiquee lsiddiquee deleted the feature/sample-azure-search branch June 26, 2025 08:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a top‐level samples index, enhances existing samples with logging via a new FunctionLogger, refines the DefaultValue sample, and adds a new Azure AI Search sample demonstrating one plugin class used across two data sources.

  • Added samples/readme.md as an entry point describing all available samples.
  • Introduced FunctionLogger and wired it into existing samples for invocation logging.
  • Updated DefaultValue sample metadata and program to use FunctionLogger and clarified parameter defaults.
  • Added AzureAiSearchPlugin sample showing how to register a single plugin class twice with distinct metadata for product vs. knowledge‐base search.

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
samples/readme.md New index of all SemanticPluginForge samples
samples/FunctionLogger.cs New invocation filter for logging plugin calls
samples/DefaultValue/Program.cs Integrated FunctionLogger, added null‐forgiving operator
samples/DefaultValue/CustomMetadataProvider.cs Adjusted metadata for unit parameter
samples/DefaultValue/DefaultValue.csproj Linked shared FunctionLogger.cs
samples/AzureAiSearchPlugin/Program.cs New sample CLI registering two plugin instances
samples/AzureAiSearchPlugin/AzureSearchPlugin.cs Plugin implementation with mock data
samples/AzureAiSearchPlugin/AzureSearchMetadataProvider.cs Metadata provider differentiating product vs. KB searches
Comments suppressed due to low confidence (4)

samples/readme.md:56

  • [nitpick] Indented code fences may render incorrectly in Markdown viewers. It’s safer to start the triple backticks at column zero for consistent formatting across renderers.
```console

samples/FunctionLogger.cs:1

  • This file uses LINQ methods (Select, Enumerable.Empty) and async Task but does not import System.Linq, System, System.Threading.Tasks, or System.Collections.Generic. Add these usings to fix compilation errors.
using Microsoft.SemanticKernel;

samples/DefaultValue/Program.cs:13

  • [nitpick] Using the null-forgiving operator (!) suppresses nullable warnings but will still throw at runtime if the setting is missing. Consider validating or throwing a clear error when configuration keys are absent.
    builder.Configuration["AzureOpenAI:ChatDeploymentName"]!,

samples/AzureAiSearchPlugin/AzureSearchMetadataProvider.cs:1

  • This provider uses C# 12 collection expressions for Parameters (e.g., Parameters = [ ... ]) but does not import System.Collections.Generic. Add the appropriate using to ensure the collection literal compiles.
using Microsoft.SemanticKernel;

IsRequired = false,
Suppress = true,
Description = "The unit should be retrieved from the user context.",
IsRequired = true,

Copilot AI Jun 26, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The unit parameter is marked as required (IsRequired=true) even though you provide a default value. Consider making it optional (IsRequired=false) to avoid confusion between required inputs and default fallbacks.

Suggested change
IsRequired = true,
IsRequired = false,

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants