Align 'return type schema' section with the FunctionCalling_ReturnMetadata sample - #454
Federico Laurianti (Laurianti) wants to merge 2 commits into
Conversation
…sample Rewrite the 'Providing functions return type schema to LLM' section of the C# pivot to use the WeatherData examples from the official sample, add a comparison table of the three techniques (advertisement vs invocation step, type information, maintenance), and explain why the sample uses generic property names. Addresses microsoft/semantic-kernel#11202
|
Learn Build status updates of commit 997a241:
|
| File | Status | Preview URL | Details |
|---|---|---|---|
| semantic-kernel/concepts/plugins/index.md | Details | ||
| semantic-kernel/concepts/plugins/adding-native-plugins.md | ✅Succeeded |
semantic-kernel/concepts/plugins/index.md
- Line 447, Column 44: [Warning: bookmark-not-found - See documentation]
Cannot find bookmark '#provide-function-return-type-information-in-function-description' in 'concepts/plugins/adding-native-plugins.md'.
For more details, please refer to the build report.
Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.
There was a problem hiding this comment.
🟡 Changes recommended
The documentation examples are not runnable as shown, and navigation and metadata updates remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Updates the C# return-type schema documentation to align with the official FunctionCalling_ReturnMetadata sample.
Changes:
- Replaces ad-hoc examples with
WeatherDataplugins and filter usage. - Adds technique comparisons, expected outputs, and maintenance guidance.
- Links the official sample and explains property naming choices.
File summaries
| File | Summary |
|---|---|
semantic-kernel/concepts/plugins/adding-native-plugins.md |
Updated C# return-type metadata guidance. Two moderate issues remain with undeclared setup variables, plus nits for navigation, wording, and metadata updates. |
Review details
Suppressed comments (5)
semantic-kernel/concepts/plugins/adding-native-plugins.md:460
- This new kernel setup is not runnable as shown:
modelIdandapiKeyare never declared anywhere in this page. Replace these identifiers with the literal placeholders used by the other C# setup examples, or define them before this block.
.AddOpenAIChatCompletion(modelId, apiKey)
semantic-kernel/concepts/plugins/adding-native-plugins.md:583
- This repeated kernel setup has the same copy/paste error:
modelIdandapiKeyare not declared in the page, so the example does not compile as shown. Use literal model/key placeholders or define these values before the snippet.
.AddOpenAIChatCompletion(modelId, apiKey)
semantic-kernel/concepts/plugins/adding-native-plugins.md:426
- The
Automaticmaintenance entry is too broad: this technique generates the schema automatically, but the[Description]attributes onData1–Data4are still authored and maintained manually when the property meanings change. Qualify the cell to distinguish automatic schema generation from manual descriptions.
| Return type schema as part of the return value | During function invocation, only for the functions actually called | Yes | Automatic |
semantic-kernel/concepts/plugins/adding-native-plugins.md:418
- This page has C#, Python, and Java pivots but no language-parity table. Add a small HTML table after the frontmatter that records this return-metadata section as C#-specific (or add equivalent sections for the other languages), so future edits do not silently leave the pivots out of sync.
The examples below come from the [FunctionCalling_ReturnMetadata](https://github.com/microsoft/semantic-kernel/blob/main/dotnet/samples/Concepts/FunctionCalling/FunctionCalling_ReturnMetadata.cs) sample. The properties of the `WeatherData` class are intentionally given generic names (`Data1`, `Data2`, `Data3`, `Data4`) for demonstration purposes only: this prevents the model from making assumptions about their content based solely on their names, and forces it to rely on the other return type metadata (descriptions or schemas) to reason about them. In your own plugins, descriptive property names should always be the first choice.
semantic-kernel/concepts/plugins/adding-native-plugins.md:418
- This concept-page update leaves the document metadata incomplete:
ms.dateis still07/12/2023, and the required language-parity HTML comment is absent after the frontmatter. Please update the date to09/13/2026and add a parity table marking this return-metadata section as C#-specific (with the Python/Java exclusions explained).
The examples below come from the [FunctionCalling_ReturnMetadata](https://github.com/microsoft/semantic-kernel/blob/main/dotnet/samples/Concepts/FunctionCalling/FunctionCalling_ReturnMetadata.cs) sample. The properties of the `WeatherData` class are intentionally given generic names (`Data1`, `Data2`, `Data3`, `Data4`) for demonstration purposes only: this prevents the model from making assumptions about their content based solely on their names, and forces it to rely on the other return type metadata (descriptions or schemas) to reason about them. In your own plugins, descriptive property names should always be the first choice.
- Files reviewed: 1/1 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| Before employing any of these techniques, it is advisable to provide more descriptive names for the return type properties, as this is the most straightforward way to improve the LLM's understanding of the return type and is also cost-effective in terms of token usage. | ||
|
|
||
| #### Provide function return type information in function description | ||
| The examples below come from the [FunctionCalling_ReturnMetadata](https://github.com/microsoft/semantic-kernel/blob/main/dotnet/samples/Concepts/FunctionCalling/FunctionCalling_ReturnMetadata.cs) sample. The properties of the `WeatherData` class are intentionally given generic names (`Data1`, `Data2`, `Data3`, `Data4`) for demonstration purposes only: this prevents the model from making assumptions about their content based solely on their names, and forces it to rely on the other return type metadata (descriptions or schemas) to reason about them. In your own plugins, descriptive property names should always be the first choice. |
| | Return type schema in the function description | During function advertisement, for every function | Yes | Manual | | ||
| | Return type schema as part of the return value | During function invocation, only for the functions actually called | Yes | Automatic | | ||
|
|
||
| #### Provide function return type description in function description |
…table, bump ms.date
|
Addressed the review in the second commit:
Not applied: the language-parity HTML table. None of the seven pages under |
|
Learn Build status updates of commit fd577f0: ✅ Validation status: passed
For more details, please refer to the build report. |
|
@microsoft-github-policy-service agree |
Addresses microsoft/semantic-kernel#11202
The Providing functions return type schema to LLM section of the C# pivot used an ad-hoc
LightsPluginexample and did not explain how the three techniques differ. This change aligns it with the officialFunctionCalling_ReturnMetadatasample:WeatherDataplugins and the filter from the sample, including the kernel setup and the expected outputData1..Data4) and restates that descriptive names should be the first choiceDocs-only change, no code. The Python pivot is untouched.