Skip to content

Conversation

stephentoub
Copy link
Member

@stephentoub stephentoub commented Jul 16, 2025

So that if a DataContent has schema generated for it, it's obvious in the schema that the "uri" is specifically a data URI.

Microsoft Reviewers: Open in CodeFlow

@stephentoub stephentoub requested a review from a team as a code owner July 16, 2025 13:42
@github-actions github-actions bot added the area-ai Microsoft.Extensions.AI libraries label Jul 16, 2025
Copy link
Contributor

@Copilot 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

This PR adds a description attribute to the DataContent.Uri property so its generated JSON schema clearly indicates it’s a data URI, and introduces a test to verify that description appears in the schema.

  • Added [Description("A data URI representing the content.")] to DataContent.Uri.
  • Added a new test GenerateSchema_ContainsDataUriDescription to assert the schema includes the phrase "data URI".

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/DataContentTests.cs New test to check the schema text contains the data URI description
src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/DataContent.cs Added using System.ComponentModel and [Description(...)] on Uri property
Comments suppressed due to low confidence (1)

src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/DataContent.cs:146

  • The DescriptionAttribute is only applied when NET is defined, so on other target frameworks the JSON schema won't include the description. If schema generation supports multiple targets, consider removing the conditional so the attribute is always applied.
#if NET

So that if a DataContent has schema generated for it, it's obvious in the schema that the "uri" is specifically a data URI.
@stephentoub stephentoub enabled auto-merge (squash) July 18, 2025 03:04
@stephentoub
Copy link
Member Author

@eiriktsarpalis, any concerns?

Copy link
Member

@eiriktsarpalis eiriktsarpalis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eiriktsarpalis, any concerns?

No huge concerns, from my perspective though I'd rather have the ns2.0 build take the extra dependency as opposed it not exposing the same metadata.

@stephentoub stephentoub merged commit 8f0f5a7 into dotnet:main Jul 25, 2025
6 checks passed
This was referenced Aug 13, 2025
joakimia pushed a commit to heimdallpower/api-sdk that referenced this pull request Aug 21, 2025
Updated
[Microsoft.Extensions.Http.Resilience](https://github.com/dotnet/extensions)
from 9.7.0 to 9.8.0.

<details>
<summary>Release notes</summary>

_Sourced from [Microsoft.Extensions.Http.Resilience's
releases](https://github.com/dotnet/extensions/releases)._

## 9.8.0

## What's Changed
* Align EventId generation with M.E.Logging source-gen by @​xakep139 in
dotnet/extensions#6566
* Add resiliency mechanism to CPU and memory utilization checks by
@​amadeuszl in dotnet/extensions#6528
* Suppress flaky test until fixed by @​joelverhagen in
dotnet/extensions#6568
* Create a project template for an MCP server by @​joelverhagen in
dotnet/extensions#6547
* Use dnx instead of dotnet tool exec in MCP server template README by
@​joelverhagen in dotnet/extensions#6571
* Add reporting tests that show NLP results. by @​peterwald in
dotnet/extensions#6574
* Branding updates for 9.8.0 by @​joperezr in
dotnet/extensions#6573
* Fix `ConfigureEvaluationTests.ps1` script when `$ConfigRoot` is not
supplied by @​peterwald in
dotnet/extensions#6575
* Refactor Resource Monitoring by @​evgenyfedorov2 in
dotnet/extensions#6554
* Update McpServer template for 0.3.0-preview.2 by @​stephentoub in
dotnet/extensions#6578
* Add container.cpu.time metric by @​evgenyfedorov2 in
dotnet/extensions#5806
* Add netstandard2.0 compatibility to
Microsoft.Extensions.Diagnostics.Testing and dependencies by @​bdovaz in
dotnet/extensions#6219
* Add netstandard2.0 compatibility to Microsoft.Extensions.Telemetry and
dependencies by @​bdovaz in
dotnet/extensions#6218
* Simplify Http.Diagnostics by @​pentp in
dotnet/extensions#6174
* Add netstandard2.0 compatibility to
Microsoft.Extensions.Http.Resilience and dependencies by @​bdovaz in
dotnet/extensions#6582
* Ingore null loggers returned by LogProviders in ELoggerFactory by
@​petrroll in dotnet/extensions#6585
* Merging changes from internal by @​joperezr in
dotnet/extensions#6588
* [Logging] Fixes LogProperties and LogPropertyIgnore attributes to work
if an object being logged resides in a different assembly than the
logging method by @​iliar-turdushev in
dotnet/extensions#6600
* Add memory usage metric by @​evgenyfedorov2 in
dotnet/extensions#6586
* Add schema version to server.json in MCP template by @​joelverhagen in
dotnet/extensions#6606
* Merge release/9.7 into main by @​joperezr in
dotnet/extensions#6589
* Update MCP server template readme to show both VS Code and Visual
Studio notes by @​Copilot in
dotnet/extensions#6591
* Update Azure Open AI package referenced by eval integration tests by
@​shyamnamboodiripad in dotnet/extensions#6609
* Target .NET 8 for more stable runtime requirement by @​joelverhagen in
dotnet/extensions#6617
* Add support for new Azure AI Foundry project type for Safety evals by
@​shyamnamboodiripad in dotnet/extensions#6621
* M.E.AI.AzureAIInference - Azure.AI.Inference Package Bump by
@​rogerbarreto in dotnet/extensions#6624
* Add DataContent.Name property by @​stephentoub in
dotnet/extensions#6616
* Fix handling of multiple responses messages by @​stephentoub in
dotnet/extensions#6627
* Expose additional chat model conversion helpers by @​stephentoub in
dotnet/extensions#6629
* [main] Update dependencies from dotnet/arcade by @​dotnet-maestro[bot]
in dotnet/extensions#6633
* [Http.Resilience] The DisableFor method should try to retrieve the
request object from the resilience context by @​iliar-turdushev in
dotnet/extensions#6618
* Bump Package validation baseline version to 9.7.0 by @​Copilot in
dotnet/extensions#6650
* Fix internal package version detection for project templates by
@​MackinnonBuck in dotnet/extensions#6651
* Remove `Microsoft.Extensions.AI.Ollama` by @​MackinnonBuck in
dotnet/extensions#6655
* Fix M.E.AI package refs by @​stephentoub in
dotnet/extensions#6654
* Add [Description] to DataContent.Uri by @​stephentoub in
dotnet/extensions#6615
* Fix duplicate solution file when creating an AI Chat Web app from VS
by @​MackinnonBuck in dotnet/extensions#6653
* Add ChatMessage.CreatedAt by @​stephentoub in
dotnet/extensions#6657
* Add TextContent.Annotations by @​stephentoub in
dotnet/extensions#6619
* Add FunctionInvokingChatClient.AdditionalTools by @​stephentoub in
dotnet/extensions#6661
* Fix unintentional test env var change by @​stephentoub in
dotnet/extensions#6660
* Add more openai conversion helpers by @​stephentoub in
dotnet/extensions#6662
* Add OriginalRepoCommitHash to assemblies by @​BrennanConroy in
dotnet/extensions#6667
* Include a trivial items keyword if missing. by @​eiriktsarpalis in
dotnet/extensions#6669
* Add resolution of function parameter level data annotation attributes.
by @​eiriktsarpalis in dotnet/extensions#6671
* Fix issue with NetSourceIndexStage1 for dependency conflict versions
by @​joperezr in dotnet/extensions#6672
* Expose streaming conversion utility methods by @​stephentoub in
dotnet/extensions#6636
* Couple of fixes for MEAI.Evaluation by @​shyamnamboodiripad in
dotnet/extensions#6673
* Fix one more version conflict on the docs transport package by
@​joperezr in dotnet/extensions#6675
 ... (truncated)

## 9.7.2

## Packages Released

* [Microsoft.Extensions.AI.Templates
9.7.2-preview.3.25366.2](https://www.nuget.org/packages/Microsoft.Extensions.AI.Templates/9.7.2-preview.3.25366.2)

## What's Changed

* Target .NET 8 for more stable runtime requirement by @​joelverhagen in
#​6617

**Full Changelog**:
dotnet/extensions@v9.7.1...v9.7.2

## 9.7.1

## Packages Released

* [Microsoft.Extensions.AI
9.7.1](https://www.nuget.org/packages/Microsoft.Extensions.AI/9.7.1)
* [Microsoft.Extensions.AI.Abstractions
9.7.1](https://www.nuget.org/packages/Microsoft.Extensions.AI.Abstractions/9.7.1)
* [Microsoft.Extensions.AI.OpenAI
9.7.1-preview.1.25365.4](https://www.nuget.org/packages/Microsoft.Extensions.AI.OpenAI/9.7.1-preview.1.25365.4)
* [Microsoft.Extensions.AI.AzureAIInference
9.7.1-preview.1.25365.4](https://www.nuget.org/packages/Microsoft.Extensions.AI.AzureAIInference/9.7.1-preview.1.25365.4)
* [Microsoft.Extensions.AI.Templates
9.7.1-preview.3.25365.4](https://www.nuget.org/packages/Microsoft.Extensions.AI.Templates/9.7.1-preview.3.25365.4)

## What's Changed

* Merging changes from internal by @​joperezr in #​6588
* Bump FunctionInvokingChatClient.MaximumIterationsPerRequest from 10 to
40 by @​stephentoub in #​6599
* Expose M.E.AI.OpenAI input message conversions by @​stephentoub in
#​6601
* Add schema version to server.json in MCP template by @​joelverhagen in
#​6606
* Update MCP server template readme to show both VS Code and Visual
Studio notes by @​jeffhandley in #​6591
* Fix schema generation for Nullable<T> function parameters. by
@​eiriktsarpalis in #​6596
* Branding updates for 9.7.1 by @​joperezr in
dotnet/extensions#6611
* Add DelegatingAIFunction by @​stephentoub in
dotnet/extensions#6565
* Add FunctionInvokingChatClient.FunctionInvoker delegate by
@​stephentoub in dotnet/extensions#6564
* Enable specifying "strict" for OpenAI clients via ChatOptions by
@​stephentoub in dotnet/extensions#6552
* AIFunctionFactory: tolerate JSON string function parameters. by
@​eiriktsarpalis in dotnet/extensions#6572
* AIFunctionFactory: add test coverage for JSON comments. by
@​eiriktsarpalis in dotnet/extensions#6576
* Update M.E.AI.OpenAI for latest OpenAI release by @​stephentoub in
dotnet/extensions#6577
* Update OpenTelemetry semantic conventions version from 1.35 to 1.36 by
@​Copilot in dotnet/extensions#6579
* AIFunctionFactory: add a flag for disabling return schema generation.
by @​eiriktsarpalis in dotnet/extensions#6551
* Bump FunctionInvokingChatClient.MaximumIterationsPerRequest from 10 to
40 by @​stephentoub in dotnet/extensions#6599
* Expose M.E.AI.OpenAI input message conversions by @​stephentoub in
dotnet/extensions#6601
* Fix schema generation for Nullable<T> function parameters. by
@​eiriktsarpalis in dotnet/extensions#6596


**Full Changelog**:
dotnet/extensions@v9.7.0...v9.7.1

Commits viewable in [compare
view](dotnet/extensions@v9.7.0...v9.8.0).
</details>

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Microsoft.Extensions.Http.Resilience&package-manager=nuget&previous-version=9.7.0&new-version=9.8.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This was referenced Aug 22, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Aug 25, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-ai Microsoft.Extensions.AI libraries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants