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
Conversation
… for different sources eg. azure ai search on two different index. Updated the readme of the samples.
There was a problem hiding this comment.
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
FunctionLoggerand 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 asyncTaskbut does not importSystem.Linq,System,System.Threading.Tasks, orSystem.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 importSystem.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, |
There was a problem hiding this comment.
[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.
| IsRequired = true, | |
| IsRequired = false, |
Adding a sample which showcases how to use a single client/plugin but for different sources eg. azure ai search on two different index