Skip to content

Commit

Permalink
pack agenthost as tool (#5647)
Browse files Browse the repository at this point in the history
<!-- 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 #1234" -->

closes #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.
  • Loading branch information
rysweet authored Feb 24, 2025
1 parent 159e4f1 commit 78adf32
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 13 deletions.
11 changes: 11 additions & 0 deletions docs/dotnet/core/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,17 @@ using Microsoft.AutoGen.AgentHost;
var autogenBackend = await Microsoft.AutoGen.RuntimeGateway.Grpc.Host.StartAsync(local: false, useGrpc: true).ConfigureAwait(false);
```

You can also install the runtime as a dotnet tool:

```
dotnet pack --no-build --configuration Release --output './output/release' -bl\n
dotnet tool install --add-source ./output/release Microsoft.AutoGen.AgentHost
# run the tool
# dotnet agenthost
# or just...
agenthost
```

### Running Multiple Agents and the Runtime in separate processes with .NET Aspire

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).
Expand Down
6 changes: 4 additions & 2 deletions dotnet/.config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
"version": "0.1.205",
"commands": [
"dotnet-repl"
]
],
"rollForward": true
},
"docfx": {
"version": "2.67.5",
"commands": [
"docfx"
]
],
"rollForward": true
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,16 @@
<ContainerRepository>autogen-host</ContainerRepository>
<ContainerFamily>alpine</ContainerFamily>
<EnableSdkContainerSupport>true</EnableSdkContainerSupport>
</PropertyGroup>

<PackAsTool>true</PackAsTool>
<ToolCommandName>agenthost</ToolCommandName>
<PackageOutputPath>./nupkg</PackageOutputPath>
</PropertyGroup>



<Import Project="$(RepoRoot)/nuget/nuget-package.props" />

<ItemGroup>
<ContainerEnvironmentVariable Include="ASPNETCORE_HTTP_PORTS" Value="5001" />
<ContainerPort Include="5001" Type="tcp" />
Expand Down
10 changes: 0 additions & 10 deletions python/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 78adf32

Please sign in to comment.