-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'refs/heads/main' into agentic_memory
# Conflicts: # python/uv.lock
- Loading branch information
Showing
289 changed files
with
6,233 additions
and
16,666 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
############### | ||
# folder # | ||
############### | ||
/**/DROP/ | ||
/**/TEMP/ | ||
/**/packages/ | ||
/**/bin/ | ||
/**/obj/ | ||
|
||
# build artifacts for web | ||
_site/ | ||
api/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
## How to build and run the website | ||
|
||
### Prerequisites | ||
- dotnet 7.0 or later | ||
|
||
### Build | ||
Firstly, go to autogen/dotnet folder and run the following command to build the website: | ||
```bash | ||
dotnet tool restore | ||
dotnet tool run docfx website/docfx.json --serve | ||
``` | ||
|
||
After the command is executed, you can open your browser and navigate to `http://localhost:8080` to view the website. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Differences from Python | ||
|
||
## Publishing to a topic that an agent is also subscribed to | ||
|
||
> [!NOTE] | ||
> TLDR; Default behavior is identical. | ||
When an agent publishes a message to a topic to which it also listens, the message will not be received by the agent that sent it. This is also the behavior in the Python runtime. However to support previous usage, in @Microsoft.AutoGen.Core.InProcessRuntime, you can set the @Microsoft.AutoGen.Core.InProcessRuntime.DeliverToSelf property to true in the TopicSubscription attribute to allow an agent to receive messages it sends. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# AutoGen Core | ||
|
||
AutoGen Core for .NET follows the same concepts and conventions of its Python counterpart. In fact, in order to understand the concepts in the .NET version, we recommend reading the Python documentation first. Unless otherwise stated, the concepts in the Python version map to .NET. | ||
|
||
Any important differences between the language versions are documented in the [Differences from Python](./differences-from-python.md) section. For things that only affect a given language, such as dependency injection or host builder patterns, these will not be specified in the differences document. | ||
|
||
For .NET we are starting with the core functionality and will be expanding support progressively. So far the core abstractions of Agent and Runtime are available. The InProcessRuntime is the only runtime available at this time. We will be expanding to cross language support in upcoming releases. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Installation | ||
|
||
Install via `.NET cli` | ||
|
||
```sh | ||
dotnet add package Microsoft.AutoGen.Contracts --version 0.4.0-dev.1 | ||
dotnet add package Microsoft.AutoGen.Core --version 0.4.0-dev.1 | ||
``` | ||
|
||
Or, install via `Package Manager` | ||
|
||
```pwsh | ||
PM> NuGet\Install-Package Microsoft.AutoGen.Contracts -Version 0.4.0-dev.1 | ||
PM> NuGet\Install-Package Microsoft.AutoGen.Core -Version 0.4.0-dev.1 | ||
``` | ||
|
||
Or, add via `<PackageReference>` | ||
|
||
```xml | ||
<PackageReference Include="Microsoft.AutoGen.Contracts" Version="0.4.0-dev.1" /> | ||
<PackageReference Include="Microsoft.AutoGen.Core" Version="0.4.0-dev.1" /> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Using Protocol Buffers to Define Message Types | ||
|
||
For a message to be sent using a runtime other than the @Microsoft.AutoGen.Core.InProcessRuntime, it must be defined as a Protocol Buffers message. This is because the message is serialized and deserialized using Protocol Buffers. This requirement may be relaxed in future by allowing for converters, custom serialization, or other mechanisms. | ||
|
||
## How to include Protocol Buffers in a .NET project | ||
|
||
The .proto file which defines the message types must be included in the project, which will automatically generate the C# classes for the messages. | ||
|
||
1. Include `Grpc.Tools` package in your `.csproj` file: | ||
|
||
```xml | ||
<PackageReference Include="Grpc.Tools" PrivateAssets="All" /> | ||
``` | ||
|
||
2. Create an include a `.proto` file in the project: | ||
|
||
```xml | ||
<ItemGroup> | ||
<Protobuf Include="messages.proto" GrpcServices="Client;Server" Link="messages.proto" /> | ||
</ItemGroup> | ||
``` | ||
|
||
3. define your messages as specified in the [Protocol Buffers Language Guide](https://protobuf.dev/programming-guides/proto3/) | ||
|
||
```proto | ||
syntax = "proto3"; | ||
package HelloAgents; | ||
option csharp_namespace = "MyAgentsProtocol"; | ||
message TextMessage { | ||
string Source = 1; | ||
string Content = 2; | ||
} | ||
``` | ||
|
||
4. Code against the generated class for handling, sending and publishing messages: | ||
|
||
```csharp | ||
using Microsoft.AutoGen.Contracts; | ||
using Microsoft.AutoGen.Core; | ||
using MyAgentsProtocol; | ||
|
||
[TypeSubscription("default")] | ||
public class Checker( | ||
AgentId id, | ||
IAgentRuntime runtime, | ||
) : | ||
BaseAgent(id, runtime, "MyAgent", null), | ||
IHandle<TextMessage> | ||
{ | ||
public async ValueTask HandleAsync(TextMessage item, MessageContext messageContext) | ||
{ | ||
Console.WriteLine($"Received message from {item.Source}: {item.Content}"); | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
- name: Overview | ||
href: index.md | ||
- name: Installation | ||
href: installation.md | ||
- name: Tutorial | ||
href: tutorial.md | ||
- name: Differences from Python | ||
href: differences-from-python.md | ||
- name: Protobuf message types | ||
href: protobuf-message-types.md |
Oops, something went wrong.