Skip to content

feat: Added Trimming/NativeAOT support. - #21

Merged
joseharriaga merged 12 commits into
openai:mainfrom
HavenDV:trimming
Jan 21, 2025
Merged

joseharriaga merged 12 commits into
openai:mainfrom
HavenDV:trimming

Conversation

@HavenDV

@HavenDV HavenDV commented Jun 7, 2024 •

Copy link
Copy Markdown
Contributor

Closes #20

But because preview version of System.Memory.Data does not explicitly support net6.0, this warning appears here

0>System.Text.Encodings.Web.targets(4,5): Warning  : System.Text.Encodings.Web 9.0.0-preview.4.24266.19 doesn't support net6.0 and has not been tested with it. Consider upgrading your TargetFramework to net8.0 or later. You may also set <SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings> in the project file to ignore this warning and attempt to run in this unsupported configuration at your own risk.
0>Microsoft.Bcl.AsyncInterfaces.targets(4,5): Warning  : Microsoft.Bcl.AsyncInterfaces 9.0.0-preview.4.24266.19 doesn't support net6.0 and has not been tested with it. Consider upgrading your TargetFramework to net8.0 or later. You may also set <SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings> in the project file to ignore this warning and attempt to run in this unsupported configuration at your own risk.
0>System.Text.Json.targets(4,5): Warning  : System.Text.Json 9.0.0-preview.4.24266.19 doesn't support net6.0 and has not been tested with it. Consider upgrading your TargetFramework to net8.0 or later. You may also set <SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings> in the project file to ignore this warning and attempt to run in this unsupported configuration at your own risk.
0>System.Memory.Data.targets(4,5): Warning  : System.Memory.Data 9.0.0-preview.4.24266.19 doesn't support net6.0 and has not been tested with it. Consider upgrading your TargetFramework to net8.0 or later. You may also set <SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings> in the project file to ignore this warning and attempt to run in this unsupported configuration at your own risk.

There are two ways out:

  • Ignore, this can work without problems
  • Add #ifdef/ MSBuild Conditions to use old behavior for net6 and new for net8/netstandard

I'm waiting for feedback

@HavenDV
HavenDV marked this pull request as ready for review June 7, 2024 07:40

@KrzysztofCwalina KrzysztofCwalina left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the contribution! The core fixes look good! I just have a question and a change request I commented inline in the sources.

Comment thread OpenAI.sln Outdated
Comment thread src/OpenAI.csproj Outdated
Comment thread src/OpenAI.csproj Outdated
Comment thread src/Custom/Common/InternalListHelpers.cs Outdated
Comment thread src/OpenAI.csproj
@jcoc611-microsoft

Copy link
Copy Markdown

@HavenDV @KrzysztofCwalina any chance we could revive this PR and merge it in? would be super useful to get NAOT support (plus source generated JSON parsing would likely be more efficient than reflection)

@KrzysztofCwalina

Copy link
Copy Markdown
Contributor

@HavenDV @KrzysztofCwalina any chance we could revive this PR and merge it in? would be super useful to get NAOT support (plus source generated JSON parsing would likely be more efficient than reflection)

Once you remove the trimming helper, I can unblock this PR.

# Conflicts:
#	OpenAI.sln
#	src/Custom/Common/InternalListHelpers.cs
#	src/Custom/OpenAIModelFactory.cs
#	src/OpenAI.csproj
@HavenDV

HavenDV commented Nov 15, 2024

Copy link
Copy Markdown
Contributor Author

@HavenDV @KrzysztofCwalina any chance we could revive this PR and merge it in? would be super useful to get NAOT support (plus source generated JSON parsing would likely be more efficient than reflection)

Once you remove the trimming helper, I can unblock this PR.

It has been removed

@HavenDV HavenDV changed the title feat: Added initial Trimming support. feat: Added Trimming support. Dec 2, 2024
@KrzysztofCwalina

Copy link
Copy Markdown
Contributor

Thanks! Looks good!

@HavenDV HavenDV changed the title feat: Added Trimming support. feat: Added Trimming/NativeAOT support. Dec 5, 2024
@heartacker

Copy link
Copy Markdown

anyothers approve.please

@joseharriaga

Copy link
Copy Markdown
Collaborator

Hello, @HavenDV ! We are working on a fix in our code generator that will take care of the file under the "src/Generated" folder. Current ETA is to have it merged soon after the holidays. Once that is in, we should be good to merge this PR too. I will keep you posted. Thank you!

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.

Trimming/NativeAOT support

7 participants