<!-- Thank you for your contribution! Please review
https://microsoft.github.io/autogen/docs/Contribute before opening a
pull request. -->
<!-- Please add a reviewer to the assignee section when you create a PR.
If you don't have the access to it, we will shortly find a reviewer and
assign them to your PR. -->
## Why are these changes needed?
<!-- Please give a short summary of the change and the problem this
solves. -->
## Related issue number
<!-- For example: "Closes #1234" -->
## Checks
- [ ] I've included any doc changes needed for
<https://microsoft.github.io/autogen/>. See
<https://github.com/microsoft/autogen/blob/main/CONTRIBUTING.md> to
build and test documentation locally.
- [ ] I've added tests (if relevant) corresponding to the changes
introduced in this PR.
- [ ] I've made sure all auto checks have passed.
For some reason --locked is causing the CI to fall over in the codesign
pipeline.
Unclear why it is not happening on the GitHub Actions side - though it
may be an artifact of the way we have the uv cache set up (and the uv
install version does not match between the two). Getting to a building
state, then will investigate further.
During the recent fix to SendMessageAsync's recurrence, we added code to ensure blocking on Publish. This adds additional resilience to the Publish delivery, ensuring that every subscribed agent receives the message, regardless of errors in the middle.
* Also adds --locked to the `uv sync` call in the Integration Tests project; this will hopefully reduce how much the uv.lock file is mangled during .NET development
In the .NET InProcessRuntime we tried to minimize the amount of tasks
created. Unfortunately, this results in a deadlock when a send message
handler is attempting to SendMessage during the handling of the incoming
message.
The fix is to create a new task for delivering the message in the
message processing loop, which creates a new logical stack to run the
delivery, freeing the loop to process the next delivery request.
* Also fixes passing exceptions and cancellations back to the waiting
task.
* Also fixes a build slowdown on Windows due to uv and llama-cpp
Closes#5915
Factors out RunContext management into separate classes:
* Defines a LifecycleObject abstraction to manage initialization /
deinitialization
* Defines RunContextStack to enable a stack of init/deinit layers
* Defines a RunManager to own ensuring proper semantics for performing a
"single execution at a time" call while enabling a polymorphic base.
Implements Reset
Closes#5799
Unblocks #5800 (needs RunContext refactor too)
The `SemanticKernelAgent` class has been updated to include an optional
`modelServiceId` parameter, allowing the specification of a service ID
for the model.
## Why are these changes needed?
Currently, `SemanticKernelAgent` uses the parameterless method for
resolving `IChatCompletionSerivce`. This will fail, when multiple models
are registered in the Kernel.
To support different models registered in the Kernel, I adopted the
resolving of the `IChatCompletionSerivce` within the
`SemanticKernelAgent` with an optional parameter. When it is not set, I
resolve the default instance, otherwise, I use the optional parameter as
a servide id for resolving the `IChatCompletionSerivce` service.
## Related issue number
## Checks
- [x] I've included any doc changes needed for
https://microsoft.github.io/autogen/. See
https://microsoft.github.io/autogen/docs/Contribute#documentation to
build and test documentation locally.
- [x] I've added tests (if relevant) corresponding to the changes
introduced in this PR.
- [x] I've made sure all auto checks have passed.
---------
Co-authored-by: Ryan Sweet <rysweet@microsoft.com>
Co-authored-by: Xiaoyun Zhang <bigmiao.zhang@gmail.com>
sometimes a client will subscribe but the message it was hoping for is
already published and delivered to one of its peers but it missed it.
this adds a five second (default) buffer and will deliver buffered
messages to new subscribers. messages are removed from the buffer after
5 seconds
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* integration tests used to use the samples - now they are separate
* patch dictionary problem in serializer
* add Message Registry with dead letter queue that gets checked on new
subs.
the uv sync logging in the test build was really noisy - no longer
needed
## Why are these changes needed?
## Related issue number
## Checks
- [ ] I've included any doc changes needed for
https://microsoft.github.io/autogen/. See
https://microsoft.github.io/autogen/docs/Contribute#documentation to
build and test documentation locally.
- [ ] I've added tests (if relevant) corresponding to the changes
introduced in this PR.
- [ ] I've made sure all auto checks have passed.
<!-- Thank you for your contribution! Please review
https://microsoft.github.io/autogen/docs/Contribute before opening a
pull request. -->
<!-- Please add a reviewer to the assignee section when you create a PR.
If you don't have the access to it, we will shortly find a reviewer and
assign them to your PR. -->
## Why are these changes needed?
<!-- Please give a short summary of the change and the problem this
solves. -->
## Related issue number
<!-- For example: "Closes #1234" -->
## Checks
- [ ] I've included any doc changes needed for
https://microsoft.github.io/autogen/. See
https://microsoft.github.io/autogen/docs/Contribute#documentation to
build and test documentation locally.
- [ ] I've added tests (if relevant) corresponding to the changes
introduced in this PR.
- [ ] I've made sure all auto checks have passed.
Unlike with the InProcessRuntime, there is a two-phase initialization,
first when AgentsApp is built (when initial agents are registered) and
when it StartAsync()s and connects to the Gateway. Unfortunately, it is
possible to attempt to send direct RPC calls to the Gateway before the
message channel is opened; in this case, the Gateway has no connected
client corresponding to the RPC's clientId, and falls over.
The fix is to defer registering agents and subscriptions with the
gateway until after the connection is established after .StartAsync() is
called.
Restoring the grpc + Orleans server into the project
## Why are these changes needed?
This is the distributed agent runtime for .NET that can manage routing
messages amongst a fleet of grpc agent runtimes.
## Related issue number
## Checks
- [ ] I've included any doc changes needed for
https://microsoft.github.io/autogen/. See
https://microsoft.github.io/autogen/docs/Contribute#documentation to
build and test documentation locally.
- [x] I've added tests (if relevant) corresponding to the changes
introduced in this PR.
- [x] I've made sure all auto checks have passed.
---------
Co-authored-by: Jack Gerrits <jack@jackgerrits.com>
Co-authored-by: Jacob Alber <jaalber@microsoft.com>
This is in preparation for releasing the Microsoft.AutoGen.Core NuGet
package.
* Moves IHandle<> to Microsoft.AutoGen.Contracts
* Makes KVStringParseHelper internal
* Updates versions of certain dependencies
* Updates NuGet package properties
* Enables deterministic build
* Enables ContinuousIntegrationBuild in CI
Moves the semantics of message delivery in .NET to be closer to Python
(up to vagaries of differences in Threading)
* Creates a message delivery queue in InProcessRuntime
* Creates Start/Stop/WaitForIdle APIs on InProcessRuntime
* Creates API to step individual messages
* Updates InProcessRuntime to play well with IHost as an IHostedService
this is work to align dotnet autogen with python
## Why are these changes needed?
bringing alignment between the projects
## Related issue number
close#5217
## Checks
- [ ] I've included any doc changes needed for
https://microsoft.github.io/autogen/. See
https://microsoft.github.io/autogen/docs/Contribute#documentation to
build and test documentation locally.
- [x ] I've added tests (if relevant) corresponding to the changes
introduced in this PR.
- [ ] I've made sure all auto checks have passed.
* add Registry abstractions and Registry Storage to Core/Contracts
* brings Grpc in line with these abstractions
* add registeragenttype to in memory runtime. Note it's not necessary to
call this because we register all the agents with reflection unless you
tell the runtime not to.....
## Why are these changes needed?
Bringing the .NET more in line with the python
## Related issue number
close#5207
## Checks
- [] I've included any doc changes needed for
https://microsoft.github.io/autogen/. See
https://microsoft.github.io/autogen/docs/Contribute#documentation to
build and test documentation locally.
- [x ] I've added tests (if relevant) corresponding to the changes
introduced in this PR.
- [x] I've made sure all auto checks have passed.
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Changes to align the .NET code more with the python codebase.
* rename *Worker to *Runtime
* refactor shared runtime elements to AgentRuntimeBase
* align runtime interface with python
## Why are these changes needed?
Aligning the .NET with the python code and then we can evolve together
from there.
## Related issue number
Closes#5201
* moves AgentId into Agent
* Renames AgentRuntime to AgentMessenger (more accurate name)
* Remove IAgentRuntime Interface
* changes constructor of Agent to take IAgentWorker instead of IAgentRuntime
* move optional base agents to separate package
* rename main sdk to Core
* reduce dependency graph
Co-authored-by: @rysweet
Authored-by: @kostapetan
Co-authored-by: @kopetan-ms
* refactor renaming agent base
* 1st draft
* 1st draft
* format
* rename the tsts
* move IagentWorker
* 1st draft
* format
* gen-proto
* run gen-proto-samples
* format
* merge problem format