KEMBAR78
Update to stable Microsoft.Extensions.AI release by stephentoub · Pull Request #6552 · microsoft/autogen · GitHub
Skip to content

Conversation

@stephentoub
Copy link
Member

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

@codecov
Copy link

codecov bot commented May 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.40%. Comparing base (446da62) to head (c588738).
Report is 1 commits behind head on main.

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     
Flag Coverage Δ
unittests 75.40% <ø> (-4.12%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jackgerrits jackgerrits requested a review from Copilot May 19, 2025 20:22
@jackgerrits jackgerrits merged commit fffa61f into microsoft:main May 19, 2025
65 checks passed
Copy link
Contributor

Copilot AI left a 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);
Copy link

Copilot AI May 19, 2025

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.

Suggested change
var result = await lambda(new(arguments), CancellationToken.None);
var result = await lambda(new AIFunctionArguments(arguments), CancellationToken.None);

Copilot uses AI. Check for mistakes.

Comment on lines +68 to +70
<PackageVersion Include="Microsoft.Extensions.AI.AzureAIInference" Version="$(MicrosoftExtensionsAIPreviewVersion)" />
<PackageVersion Include="Microsoft.Extensions.AI.Ollama" Version="$(MicrosoftExtensionsAIPreviewVersion)" />
<PackageVersion Include="Microsoft.Extensions.AI.OpenAI" Version="$(MicrosoftExtensionsAIPreviewVersion)" />
Copy link

Copilot AI May 19, 2025

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.

Suggested change
<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.

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