-
Notifications
You must be signed in to change notification settings - Fork 829
Merge internal changes #6437
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
Merge internal changes #6437
Conversation
Changes in preparation of 9.5 stable release ---- #### AI description (iteration 1) #### PR Classification This PR prepares the upcoming 9.5 stable release by updating dependency versions and adjusting build and pipeline configurations. #### PR Summary The changes update version numbers and release settings while refining the CI pipeline and NuGet feed setup for a stable release build. - **`eng/Version.Details.xml` & `eng/Versions.props`**: Updated dependency versions from 9.0.4 to 9.0.5 (and LTS versions from 8.0.15 to 8.0.16) and enabled release-specific properties. - **`NuGet.config`**: Revised package source mappings by adding and disabling internal feed sources. - **`azure-pipelines.yml`**: Removed the code coverage stage and updated stage dependencies. - **`eng/pipelines/templates/BuildAndTest.yml`**: Added tasks for setting up private NuGet feed credentials on both Windows (PowerShell) and non-Windows (Bash) agents. - **`Directory.Build.props`**: Disabled the NU1507 warning to accommodate the internal feed configuration changes. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
Refusals in OpenAI are errors reported when the service can't generate an output that matches the requested schema. Translate refusals to ErrorContent now that we have it.
* Rename useJsonSchema parameter The `GetResponseAsync<T>` methods accept a `bool?` parameter currently called `useJsonSchema`. This is confusing, because the whole point of the method is to create and use a JSON schema from the `T`. The parameter actually controls _how_ that schema is used, whether it's included as part of the messages (false), as part of a ChatResponseFormat in the ChatOptions (true), or up to the system to decide. I've clarified it by renaming it from `useJsonSchema` to `useJsonSchemaResponseFormat`. It's wordier, but it disambiguates the intent. * Update src/Libraries/Microsoft.Extensions.AI/ChatCompletion/ChatClientStructuredOutputExtensions.cs Co-authored-by: Eirik Tsarpalis <[email protected]> --------- Co-authored-by: Eirik Tsarpalis <[email protected]>
…tnet#6383) * Add initial schema transformation functionality and incorporate into the OpenAI leaf client. * Update all leaf client implementions, improve naming, add testing. * Remove redundant suppressions * Address feedback.
Details for this change are available in dotnet#6387. Fixes dotnet#6387
* Look for OpenAI.ChatCompletionOptions in top-level additional properties and stop looking for individually specific additional properties * Add RawRepresentation to ChatOptions and use it in OpenAI and AzureAIInference * Remove now unused locals * Add [JsonIgnore] and update roundtrip tests * Overwirte properties only if the underlying model don't specify it already * Clone RawRepresentation * Reflection workaround for ToolChoice not being cloned * Style changes * AI.Inference: Bring back propagation of additional properties * Don't use 0.1f, it doesn't roundtrip properly in .NET Framework * Add RawRepresentationFactory instead of object? property * Augment remarks to discourage returning shared instances * Documentation feedback * AI.Inference: keep passing TopK as AdditionalProperty if not already there
Also fixed the name of the LoggingSpeechToTextClientBuilderExtensions type to conform to patterns used elsewhere in the library.
In dotnet#6148, we disabled net9.0 TFM for the aieval tool to work around the race described in dotnet/sdk#47696. The underlying issue was subsequently fixed in the SDK (via dotnet/sdk#47788). However, this fix has not been backported to the dotnet 9 SDK yet. The SDK team is working on backporting the fix (see discussion in dotnet/sdk#47788 (comment)). But in the meanwhile, we can add back the net9.0 TFM and continue to work around the race by disabling parallel build. This would help users of the aieval tool sidestep errors such as the ones described in dotnet#6388 when they dont have dotnet8 installed on the machine. We can remove this workaround, once the backported fix is available in the dotnet 9 SDK. Fixes dotnet#6388
* Add BinaryEmbedding Also: - Renames the polymorphic discriminators to conform with typical lingo for these types. - Adds an Embedding.Dimensions virtual property.
…erties on report (dotnet#6377) * Add documentation around proper usage of IDistributedCache * Add Content-Security-Policy to prevent page from calling into other sites. * Remove remark about IDistributedCache usage * Fix package-lock.json * Remove <remarks> start tag.
…AI.Evaluation.Reporting/TypeScript (dotnet#6354) * Bump vite Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 6.2.6 to 6.3.4. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v6.3.4/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-version: 6.3.4 dependency-type: direct:development ... Signed-off-by: dependabot[bot] <[email protected]> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Shyam Namboodiripad <[email protected]>
* Rename IResultStore and IResponseCacheProvider IResultStore -> IEvaluationResultStore and IResponseCacheProvider -> IEvaluationResponseCacheProvider * Include missing EvaluationContextConverter in AzureStorageJsonUtilities Also use linked files to avoid the need to duplicate code. * Reorder enum members The new order goes from least desirable rating to most desirable. * Refactor extension method overloads Implement overloads that take ChatMessage by calling corresponding overloads that take ChatResponse. * Refactor AddTurnDetails to support adding details for multiple turns Adding single turns continues to be supported via a params array overload. * Add missing parameter for timeToLiveForCacheEntries to DiskBasedReportingConfiguration This was missed in an earlier PR that introduced the timeToLiveForCacheEntries on the constructor of DiskBasedResponseCacheProvider. Also reorder constructor parameters for AzureStorageReportingConfiguration so that the parameters for caching apear next to each other and so that the parameter ordering is aligned with DiskBasedReportingConfiguration. * Minor formatting changes
…ons.AI.Abstractions from main This updates the release/9.5 branch with the latest from main for the MEAI/MEAI.Abstractions libraries along with compensating changes on the adapter libraries. ---- #### AI description (iteration 1) #### PR Classification This pull request implements a comprehensive API update and extensive internal refactoring for chat client, schema transformation, and embedding functionalities. #### PR Summary The changes standardize and improve internal handling of chat options, JSON schema transformation, and embedding representations while updating related tests and logging, resulting in clearer APIs and more robust behavior. - **`src/Libraries/Microsoft.Extensions.AI.OpenAI/` & `src/Libraries/Microsoft.Extensions.AI.AzureAIInference/`**: Clients now use a shared `AIJsonSchemaTransformCache` for transforming and validating JSON schemas, and additional properties (e.g., refusals) are handled more cleanly. - **`src/Libraries/Microsoft.Extensions.AI.Abstractions/Utilities/`**: New utilities and types (e.g., `AIJsonSchemaTransformOptions`, `AIJsonSchemaTransformContext`, and `AIJsonSchemaTransformCache`) have been introduced to support schema conversion and enforcement. - **`src/Libraries/Microsoft.Extensions.AI.Abstractions/Embeddings/`**: Embedding types are updated with standardized discriminator names (e.g., `"float16"`, `"float32"`, `"float64"`) and a new `BinaryEmbedding` class is added for bit-based embeddings. - **`ChatOptions` & Structured Output Extensions**: The API now supports a `RawRepresentationFactory` and renames the JSON schema parameter to `useJsonSchemaResponseFormat` for clarity and consistency. - **Test and Logging Updates**: Multiple test files and logging extension builders have been updated to reflect the new behaviors and internal changes. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
…release #### AI description (iteration 1) #### PR Classification This PR cherry picks commits for the 9.5 preview release and introduces API improvements, interface renaming, and caching logic updates. #### PR Summary The PR streamlines caching in AI Evaluation by removing legacy CacheOptions and updating related interfaces while also enhancing JSON converters and chat extension methods. Key changes include: - **`src/Libraries/Microsoft.Extensions.AI.Evaluation.Reporting/CSharp/Storage/DiskBasedResponseCache.cs`**: Removed CacheOptions logic, added a configurable TTL parameter, and refactored cache methods. - **Interface Renaming**: Renamed `IResponseCacheProvider` to `IEvaluationResponseCacheProvider` and `IResultStore` to `IEvaluationResultStore` across core code and associated tests. - **`src/Libraries/Microsoft.Extensions.AI.Evaluation.Reporting/CSharp/ChatDetailsExtensions.cs`**: Modified the `AddTurnDetails` extension to accept multiple chat turns. - **JSON Serialization**: Updated converters in `AzureStorageJsonUtilities.cs` and `JsonUtilities.cs` to use newer types (e.g., `CamelCaseEnumConverter`, `TimeSpanConverter`, and added `EvaluationContextConverter`). - **`src/Libraries/Microsoft.Extensions.AI.Evaluation/EvaluationRating.cs`**: Reordered and renamed enum values to better reflect the intended rating semantics. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
* Remove AIFunctionFactory dependency on M.E.DI This means reverting the recent changes to it that: - Special-cased KeyedServices - Special-cased IServiceProviderIsService - Used ActivatorUtilities.CreateInstance * Move AIFunctionFactory down to M.E.AI.Abstractions * Add CreateInstance delegate to AIFunctionFactoryOptions To enable use of ActivatorUtilities.CreateInstance or alternative. * Add some comments
* Fix handling of tool calls with some endpoints Most assistant messages containing tool calls don't contain text as well (though some can). In such a case, we were still creating the assistant with empty text. While OpenAI's service permits that, some other endpoints are more finicky about it. This avoids doing so. * Reduce to single iteration through assistant content
…t#6419) We use JsonSerializer.SerializeAsync but were missing the async overrides. As with MemoryStream, these don't need to queue.
* Update CHANGELOGs for M.E.AI
…eOptions and mark redundant properties in the latter as obsolete. (dotnet#6427) * Add an AIJsonSchemaTransformOptions property inside AIJsonSchemaCreateOptions and mark redundant properties in the latter as obsolete. * s/inferred/created
- Add missing [DebuggerDisplay] on AIFunctionArguments - Add WriteAsync overrides to stream helper in AIFunctionFactory - Update CHANGELOGs for M.E.AI - Replace Type targetType AIFunctionFactory.Create parameter with a func - Remove debug-level logging of updates in LoggingChatClient - Add an AIJsonSchemaTransformOptions property inside AIJsonSchemaCreateOptions and mark redundant properties in the latter as obsolete.
@joperezr The MEAI Templates tests are failing. I'm working to resolve that. |
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.
LGTM from eval standpoint 👍🏾
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.
@joperezr I think I got the MEAI Template tests passing (they pass locally for me on this branch). CI is running now. If it's green, I'm signed off. If the tests still fail, I'll continue investigating Wednesday.
FYI: @shyamnamboodiripad @jeffhandley
Microsoft Reviewers: Open in CodeFlow