-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Update to stable Microsoft.Extensions.AI release #6552
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6552 +/- ##
==========================================
- Coverage 79.52% 75.40% -4.12%
==========================================
Files 225 331 +106
Lines 16661 19779 +3118
Branches 0 406 +406
==========================================
+ Hits 13249 14914 +1665
- Misses 3412 4592 +1180
- Partials 0 273 +273
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Moves to the stable Microsoft.Extensions.AI 9.5.0 release and updates code to match API changes
- Bumps AI package versions to stable 9.5.0 and defines a preview version variable
- Adapts chat client extensions to use new GetChatClient/AsIChatClient API
- Updates function-call middleware to accept AIFunctionArguments and return ValueTask
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
ServiceCollectionChatCompletionExtensions.cs | Use GetChatClient and AsIChatClient instead of AsChatClient |
FunctionCallMiddleware.cs | Change AIToolInvokeWrapper signature to use AIFunctionArguments |
Directory.Packages.props | Bump Microsoft.Extensions.AI versions and add preview variable |
{ | ||
var arguments = JsonSerializer.Deserialize<Dictionary<string, object?>>(args); | ||
var result = await lambda(arguments, CancellationToken.None); | ||
var result = await lambda(new(arguments), CancellationToken.None); |
Copilot
AI
May 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The use of target-typed 'new(arguments)' may reduce readability; consider using the explicit constructor 'new AIFunctionArguments(arguments)' for clarity.
var result = await lambda(new(arguments), CancellationToken.None); | |
var result = await lambda(new AIFunctionArguments(arguments), CancellationToken.None); |
Copilot uses AI. Check for mistakes.
<PackageVersion Include="Microsoft.Extensions.AI.AzureAIInference" Version="$(MicrosoftExtensionsAIPreviewVersion)" /> | ||
<PackageVersion Include="Microsoft.Extensions.AI.Ollama" Version="$(MicrosoftExtensionsAIPreviewVersion)" /> | ||
<PackageVersion Include="Microsoft.Extensions.AI.OpenAI" Version="$(MicrosoftExtensionsAIPreviewVersion)" /> |
Copilot
AI
May 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Mixing stable and preview package versions for related AI packages can lead to mismatches; if stable releases exist for AzureAIInference, Ollama, and OpenAI, consider aligning them with the stable version variable or documenting the preview usage.
<PackageVersion Include="Microsoft.Extensions.AI.AzureAIInference" Version="$(MicrosoftExtensionsAIPreviewVersion)" /> | |
<PackageVersion Include="Microsoft.Extensions.AI.Ollama" Version="$(MicrosoftExtensionsAIPreviewVersion)" /> | |
<PackageVersion Include="Microsoft.Extensions.AI.OpenAI" Version="$(MicrosoftExtensionsAIPreviewVersion)" /> | |
<PackageVersion Include="Microsoft.Extensions.AI.AzureAIInference" Version="$(MicrosoftExtensionsAIVersion)" /> | |
<PackageVersion Include="Microsoft.Extensions.AI.Ollama" Version="$(MicrosoftExtensionsAIVersion)" /> | |
<PackageVersion Include="Microsoft.Extensions.AI.OpenAI" Version="$(MicrosoftExtensionsAIVersion)" /> |
Copilot uses AI. Check for mistakes.
Why are these changes needed?
Moves to the stable 9.5.0 release instead of a preview (for the core Microsoft.Extensions.AI.Abstractions and Microsoft.Extensions.AI packages).
Related issue number
Checks