Skip to content

Commit 78adf32

Browse files
authored
pack agenthost as tool (microsoft#5647)
<!-- 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? convenience - allows to just run "agenthost" ``` dotnet pack --no-build --configuration Release --output './output/release' -bl\n dotnet tool install --add-source ./output/release Microsoft.AutoGen.AgentHost agenthost ``` <!-- Please give a short summary of the change and the problem this solves. --> ## Related issue number <!-- For example: "Closes microsoft#1234" --> closes microsoft#5646 ## 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.
1 parent 159e4f1 commit 78adf32

File tree

4 files changed

+25
-13
lines changed

4 files changed

+25
-13
lines changed

docs/dotnet/core/index.md

+11
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,17 @@ using Microsoft.AutoGen.AgentHost;
8989
var autogenBackend = await Microsoft.AutoGen.RuntimeGateway.Grpc.Host.StartAsync(local: false, useGrpc: true).ConfigureAwait(false);
9090
```
9191

92+
You can also install the runtime as a dotnet tool:
93+
94+
```
95+
dotnet pack --no-build --configuration Release --output './output/release' -bl\n
96+
dotnet tool install --add-source ./output/release Microsoft.AutoGen.AgentHost
97+
# run the tool
98+
# dotnet agenthost
99+
# or just...
100+
agenthost
101+
```
102+
92103
### Running Multiple Agents and the Runtime in separate processes with .NET Aspire
93104

94105
The [Hello.AppHost project](https://github.com/microsoft/autogen/blob/50d7587a4649504af3bb79ab928b2a3882a1a394/dotnet/samples/Hello/Hello.AppHost/Program.cs#L4) illustrates how to orchestrate a distributed system with multiple agents and the runtime in separate processes using .NET Aspire. It also points to a [python agent that illustrates how to run agents in different languages in the same distributed system](https://github.com/microsoft/autogen/blob/50d7587a4649504af3bb79ab928b2a3882a1a394/python/samples/core_xlang_hello_python_agent/README.md#L1).

dotnet/.config/dotnet-tools.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66
"version": "0.1.205",
77
"commands": [
88
"dotnet-repl"
9-
]
9+
],
10+
"rollForward": true
1011
},
1112
"docfx": {
1213
"version": "2.67.5",
1314
"commands": [
1415
"docfx"
15-
]
16+
],
17+
"rollForward": true
1618
}
1719
}
1820
}

dotnet/src/Microsoft.AutoGen/AgentHost/Microsoft.AutoGen.AgentHost.csproj

+10-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,16 @@
66
<ContainerRepository>autogen-host</ContainerRepository>
77
<ContainerFamily>alpine</ContainerFamily>
88
<EnableSdkContainerSupport>true</EnableSdkContainerSupport>
9-
</PropertyGroup>
9+
10+
<PackAsTool>true</PackAsTool>
11+
<ToolCommandName>agenthost</ToolCommandName>
12+
<PackageOutputPath>./nupkg</PackageOutputPath>
13+
</PropertyGroup>
14+
15+
16+
17+
<Import Project="$(RepoRoot)/nuget/nuget-package.props" />
18+
1019
<ItemGroup>
1120
<ContainerEnvironmentVariable Include="ASPNETCORE_HTTP_PORTS" Value="5001" />
1221
<ContainerPort Include="5001" Type="tcp" />

python/uv.lock

-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)