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

.Net: feat/declarative agents #9849

Merged
merged 26 commits into from
Dec 6, 2024

Conversation

baywet
Copy link
Member

@baywet baywet commented Nov 29, 2024

fixes #9848
This is a draft PR, at this point it's not ready for a full review.
I'd like feedback on the location of the new extension method, and on the fact that I had to add a reference to the agents project.
Here is the rationale for placing it here: it needs access to the copilot agent plugins extension method and a few other types.
Here is the rationale for adding the reference to the agents project: it needs access to the kernel agent type.

Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
@markwallace-microsoft markwallace-microsoft added the .NET Issue or Pull requests regarding .NET code label Nov 29, 2024
@github-actions github-actions bot changed the title feat/declarative agents .Net: feat/declarative agents Nov 29, 2024
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
@crickman crickman added experimental Associated with an experimental feature enhancement agents labels Dec 2, 2024
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
@baywet
Copy link
Member Author

baywet commented Dec 3, 2024

Here is a recap from a few internal discussions. We don't need to make any decisions right now, but hopefully it can be used in later decisions.
The extension method is currently creating the agent object, and most properties are init only to avoid mutating the object and causing side effects.
This is problematic because the end user might want to apply additional configuration to the agent in addition to what was loaded from the declarative agent. A good example of that is using a history reducer for example.
There are a couple of ways we could offer that:

  • Adding parameters for the user to pass all things that could be properties on the agent object: This is going to provide a poor developer experience and might even require reflection because the agent type is generic.
  • Relaxing the properties to provide setters instead of init: allowing the application developer to mutate things after the object is created might have unanticipated side effects.
  • Implementing copy constructors, allowing people to pass a "configuration object": this would impact the whole inheritance tree and add additional maintenance burden.
  • Implementing a builder pattern, adding an additional builder argument so both the application developer and the extension method can call into the builder to configure the agent: possible, the extension method overload would have to call the "build" method. The build method probably needs to be async since some agent need to be initialized async
  • Implementing a factory pattern, adding an additional factory argument to an overload: similar to builder, matter of preference and consistency. Might require relaxing some init to set for both sections of the code to configure the agent.

Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
@baywet baywet requested a review from SergeyMenshykh December 4, 2024 20:20
@baywet baywet marked this pull request as ready for review December 4, 2024 20:20
@baywet baywet requested a review from a team as a code owner December 4, 2024 20:20
…thod is not annotated with not null when

Signed-off-by: Vincent Biret <vibiret@microsoft.com>
@markwallace-microsoft markwallace-microsoft added this pull request to the merge queue Dec 6, 2024
Merged via the queue into microsoft:main with commit 5a1edaf Dec 6, 2024
16 checks passed
@baywet baywet deleted the feat/declarative-agents branch December 6, 2024 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agents enhancement experimental Associated with an experimental feature .NET Issue or Pull requests regarding .NET code
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

.Net: Add support for agents loading from declarative agent manifests
4 participants