-
Notifications
You must be signed in to change notification settings - Fork 788
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
Enable AIFunctionFactory.Create to use Activator{Utilities}.Create #6193
Conversation
d467c32
to
865c832
Compare
I'm a fan. |
865c832
to
661b9db
Compare
Based on offline discussion with @halter73, I'm marking this as ready for review. |
661b9db
to
d38a921
Compare
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.
It might be worth verifying that the target type gets disposed at the end of the invocation.
…es}.Create Adds a Create overload that takes a target type and a MethodInfo. Each invocation of the AIFunction will create/dispose of a new instance, from DI if an IServiceProvider is provided, or via new() otherwise.
93fbe0a
to
7d1f864
Compare
Done |
7d1f864
to
ce26e55
Compare
Adds a Create overload that takes a target type and a MethodInfo. Each invocation of the AIFunction will create/dispose of a new instance, from DI if an IServiceProvider is provided, or via new() otherwise.
@halter73, @eiriktsarpalis, @SteveSandersonMS, how do we feel about this approach? This is based on folks asking for a capability this enables in https://github.com/modelcontextprotocol/csharp-sdk.
If we want to proceed with it, I'll add tests.
Microsoft Reviewers: Open in CodeFlow