-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3220c91
commit 7650f91
Showing
5 changed files
with
111 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
using AutoGen.Core; | ||
using AutoGen.OpenAI; | ||
using AutoGen.OpenAI.Extension; | ||
using Azure.AI.OpenAI; | ||
using ChatRoom.Github; | ||
using ChatRoom.SDK; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.Hosting; | ||
using Octokit; | ||
|
||
var roomConfig = new RoomConfiguration | ||
{ | ||
Room = "room", | ||
Port = 30000, | ||
}; | ||
|
||
var serverConfig = new ChatRoomServerConfiguration | ||
{ | ||
RoomConfig = roomConfig, | ||
YourName = "User", | ||
ServerConfig = new ServerConfiguration | ||
{ | ||
Urls = "http://localhost:50001", | ||
}, | ||
}; | ||
|
||
using var host = Host.CreateDefaultBuilder() | ||
.UseChatRoomServer(serverConfig) | ||
.Build(); | ||
|
||
await host.StartAsync(); | ||
var client = host.Services.GetRequiredService<ChatPlatformClient>(); | ||
|
||
var openAIApiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY") ?? throw new Exception("OPENAI_API_KEY is not set."); | ||
var openAIClient = new OpenAIClient(openAIApiKey); | ||
var ghClient = new GitHubClient(new ProductHeaderValue("ChatRoom")); | ||
var repoOwner = "LittleLittleCloud"; | ||
var repoName = "Agent-ChatRoom"; | ||
|
||
var issueHelper = GithubAgentFactory.CreateIssueHelperAgent(openAIClient, "gpt-4o-mini", ghClient, repoOwner, repoName); | ||
|
||
var gpt4oWriter = new OpenAIChatAgent( | ||
openAIClient: openAIClient, | ||
name: "release-note-writer", | ||
modelName: "gpt-4o-mini", | ||
systemMessage: """ | ||
You write release notes based on github issues. | ||
The release note should include the following sections: | ||
- New Features | ||
- Bug Fixes | ||
- Improvements | ||
- Documentation | ||
""") | ||
.RegisterMessageConnector() | ||
.RegisterPrintMessage(); | ||
|
||
var groupChatAdmin = new OpenAIChatAgent( | ||
openAIClient: openAIClient, | ||
name: "admin", | ||
modelName: "gpt-4o-mini") | ||
.RegisterMessageConnector() | ||
.RegisterPrintMessage(); | ||
|
||
|
||
// the user agent's name must match with ChatRoomServerConfiguration.YourName field. | ||
// When chatroom starts, it will be replaced by a built-in user agent. | ||
var userAgent = new DefaultReplyAgent("User", "<dummy>"); | ||
|
||
var groupChat = new GroupChat([userAgent, issueHelper, gpt4oWriter], admin: groupChatAdmin); | ||
|
||
// add groupchat to chatroom | ||
await client.RegisterAutoGenGroupChatAsync("release-room", groupChat); | ||
await host.WaitForShutdownAsync(); |
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,3 @@ | ||
# Agent-Chat release room | ||
|
||
This room is for drafting release notes for new releases of the Agent-Chatroom project. |
17 changes: 17 additions & 0 deletions
17
example/dotnet/gh-release-note-room/agent-chatroom-release-room.csproj
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,17 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<RootNamespace>gh_release_note_room</RootNamespace> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\..\ChatRoom\ChatRoom.Github\ChatRoom.Github.csproj" /> | ||
<ProjectReference Include="..\..\..\ChatRoom\ChatRoom.Common\ChatRoom.SDK.csproj" /> | ||
<ProjectReference Include="..\..\..\ChatRoom\ChatRoom.StaticWebUI\ChatRoom.StaticWebUI.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |