Skip to content
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

Add OpenAI serialization helper methods. #5697

Merged
merged 14 commits into from
Dec 10, 2024

Conversation

eiriktsarpalis
Copy link
Member

@eiriktsarpalis eiriktsarpalis commented Nov 26, 2024

Very early draft implementation of helper methods for serializing M.E.AI.Abstractions using the OpenAI wire format. Contains three separate commits that should be reviewed separately:

  1. a0a6696 adds a System.Net.ServerSentEvents polyfill.
  2. 339d3ad refactors the chat client so that model mapping is pulled into a standalone class.
  3. ac2a89f provides the initial skeleton implementation of the serialization methods.
Microsoft Reviewers: Open in CodeFlow

@dotnet-comment-bot
Copy link
Collaborator

‼️ Found issues ‼️

Project Coverage Type Expected Actual
Microsoft.Extensions.AI.OpenAI Line 66 34.95 🔻
Microsoft.Extensions.AI.OpenAI Branch 66 26.69 🔻

🎉 Good job! The coverage increased 🎉
Update MinCodeCoverage in the project files.

Project Expected Actual
Microsoft.Extensions.Diagnostics.Probes 70 76
Microsoft.Extensions.Caching.Hybrid 75 86

Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=881220&view=codecoverage-tab

@dotnet-comment-bot
Copy link
Collaborator

‼️ Found issues ‼️

Project Coverage Type Expected Actual
Microsoft.Extensions.AI.OpenAI Line 66 33.18 🔻
Microsoft.Extensions.AI.OpenAI Branch 66 25.54 🔻

🎉 Good job! The coverage increased 🎉
Update MinCodeCoverage in the project files.

Project Expected Actual
Microsoft.Extensions.Diagnostics.Probes 70 76
Microsoft.Extensions.Caching.Hybrid 75 86

Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=881767&view=codecoverage-tab

@eiriktsarpalis eiriktsarpalis force-pushed the openai-serializers branch 2 times, most recently from 1c49616 to 21a45ce Compare December 4, 2024 12:50
@dotnet-comment-bot
Copy link
Collaborator

‼️ Found issues ‼️

Project Coverage Type Expected Actual
Microsoft.Extensions.AI.OpenAI Line 66 33.15 🔻
Microsoft.Extensions.AI.OpenAI Branch 66 25.96 🔻

🎉 Good job! The coverage increased 🎉
Update MinCodeCoverage in the project files.

Project Expected Actual
Microsoft.Extensions.Diagnostics.Probes 70 76
Microsoft.Extensions.Caching.Hybrid 75 78
Microsoft.Extensions.AI.AzureAIInference 83 91
Microsoft.Extensions.AI.Abstractions 83 84
Microsoft.Extensions.AI 83 84

Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=886081&view=codecoverage-tab

@dotnet-comment-bot
Copy link
Collaborator

‼️ Found issues ‼️

Project Coverage Type Expected Actual
Microsoft.Extensions.AI.OpenAI Line 66 32.97 🔻
Microsoft.Extensions.AI.OpenAI Branch 66 25.18 🔻

🎉 Good job! The coverage increased 🎉
Update MinCodeCoverage in the project files.

Project Expected Actual
Microsoft.Extensions.Diagnostics.Probes 70 76
Microsoft.Extensions.Caching.Hybrid 75 77

Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=888097&view=codecoverage-tab

@dotnet-comment-bot
Copy link
Collaborator

‼️ Found issues ‼️

Project Coverage Type Expected Actual
Microsoft.Extensions.AI.OpenAI Line 66 62.79 🔻
Microsoft.Extensions.AI.OpenAI Branch 66 46.71 🔻

🎉 Good job! The coverage increased 🎉
Update MinCodeCoverage in the project files.

Project Expected Actual
Microsoft.Extensions.Caching.Hybrid 75 86
Microsoft.Extensions.Diagnostics.Probes 70 76

Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=888616&view=codecoverage-tab

@dotnet-comment-bot
Copy link
Collaborator

‼️ Found issues ‼️

Project Coverage Type Expected Actual
Microsoft.Extensions.AI.OpenAI Branch 66 65.13 🔻

🎉 Good job! The coverage increased 🎉
Update MinCodeCoverage in the project files.

Project Expected Actual
Microsoft.Extensions.Diagnostics.Probes 70 76
Microsoft.Extensions.Caching.Hybrid 75 86

Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=888641&view=codecoverage-tab

@dotnet-comment-bot
Copy link
Collaborator

‼️ Found issues ‼️

Project Coverage Type Expected Actual
Microsoft.Extensions.AI.OpenAI Branch 72 69.18 🔻

🎉 Good job! The coverage increased 🎉
Update MinCodeCoverage in the project files.

Project Expected Actual
Microsoft.Extensions.Caching.Hybrid 75 77
Microsoft.Extensions.Diagnostics.Probes 70 76

Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=889883&view=codecoverage-tab

@dotnet-comment-bot
Copy link
Collaborator

🎉 Good job! The coverage increased 🎉
Update MinCodeCoverage in the project files.

Project Expected Actual
Microsoft.Extensions.Diagnostics.Probes 70 76
Microsoft.Extensions.Caching.Hybrid 75 86
Microsoft.Extensions.AI.OpenAI 72 76
Microsoft.Extensions.AI 88 89

Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=890201&view=codecoverage-tab

@eiriktsarpalis eiriktsarpalis marked this pull request as ready for review December 9, 2024 16:35
@eiriktsarpalis eiriktsarpalis requested review from a team as code owners December 9, 2024 16:35
Copy link
Member

@SteveSandersonMS SteveSandersonMS left a comment

Choose a reason for hiding this comment

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

I know there are still some open points (e.g., about async serialization). Besides those this looks good to me.

@dotnet-comment-bot
Copy link
Collaborator

🎉 Good job! The coverage increased 🎉
Update MinCodeCoverage in the project files.

Project Expected Actual
Microsoft.Extensions.AI.OpenAI 72 77
Microsoft.Extensions.Diagnostics.Probes 70 76
Microsoft.Extensions.Caching.Hybrid 75 77

Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=891475&view=codecoverage-tab

@eiriktsarpalis eiriktsarpalis merged commit 8bc5f92 into dotnet:main Dec 10, 2024
6 checks passed
@eiriktsarpalis eiriktsarpalis deleted the openai-serializers branch December 10, 2024 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a helper for streaming IAsyncEnumerable<T> values as JSON formatted SSE events in Microsoft.Extensions.AI
4 participants