From 827f46819b5828d6c040e6f19f653af60bba2503 Mon Sep 17 00:00:00 2001 From: XiaoYun Zhang Date: Sat, 25 May 2024 00:00:03 -0700 Subject: [PATCH] update --- .../ChatRoom.Client/ChatRoomClientCommand.cs | 18 +----------------- ChatRoom/ChatRoom.Client/Program.cs | 3 --- website/get_start/install_openai_agent.md | 6 +----- website/get_start/toc.yml | 2 +- 4 files changed, 3 insertions(+), 26 deletions(-) diff --git a/ChatRoom/ChatRoom.Client/ChatRoomClientCommand.cs b/ChatRoom/ChatRoom.Client/ChatRoomClientCommand.cs index 7e55997..d46debd 100644 --- a/ChatRoom/ChatRoom.Client/ChatRoomClientCommand.cs +++ b/ChatRoom/ChatRoom.Client/ChatRoomClientCommand.cs @@ -14,18 +14,6 @@ namespace ChatRoom.Client; public class ChatRoomClientCommandSettings : CommandSettings { - [Description("The room name to create.")] - [CommandOption("-r|--room ")] - public string? Room { get; init; } = null; - - [Description("The port to listen.")] - [CommandOption("-p|--port ")] - public int? Port { get; init; } = null; - - [Description("Your name in the room")] - [CommandOption("-n|--name ")] - public string YourName { get; init; } = "User"; - [Description("Configuration file")] [CommandOption("-c|--config ")] public string? ConfigFile { get; init; } = null; @@ -39,15 +27,11 @@ public override async Task ExecuteAsync(CommandContext context, ChatRoomCli ? JsonSerializer.Deserialize(File.ReadAllText(command.ConfigFile))! : new ChatRoomClientConfiguration(); - config.RoomConfig.Room = command.Room ?? config.RoomConfig.Room; - config.RoomConfig.Port = command.Port ?? config.RoomConfig.Port; - config.YourName = command.YourName; - var host = Host.CreateDefaultBuilder() .UseOrleans(siloBuilder => { siloBuilder - .UseLocalhostClustering(config.RoomConfig.Port) + .UseLocalhostClustering(gatewayPort: config.RoomConfig.Port) .AddMemoryGrainStorage("PubSubStore") .ConfigureLogging(logBuilder => { diff --git a/ChatRoom/ChatRoom.Client/Program.cs b/ChatRoom/ChatRoom.Client/Program.cs index 61ca2a1..1fe7335 100644 --- a/ChatRoom/ChatRoom.Client/Program.cs +++ b/ChatRoom/ChatRoom.Client/Program.cs @@ -1,7 +1,4 @@ using ChatRoom.Client; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; using Spectre.Console.Cli; var app = new CommandApp(); diff --git a/website/get_start/install_openai_agent.md b/website/get_start/install_openai_agent.md index 162f88d..827e6f0 100644 --- a/website/get_start/install_openai_agent.md +++ b/website/get_start/install_openai_agent.md @@ -1,13 +1,9 @@ +## Installation To install `ChatRoom.OpenAI` agent, run the following command: ```bash dotnet tool install --global ChatRoom.OpenAI ``` -After the agent is installed, you can start the agent with the following command: -```bash -chatroom-openai -``` - ## Configuration You can configure `ChatRoom.OpenAI` agent by creating a configuration file and pass it to the agent. Below is an example of a configuration file for the agent: diff --git a/website/get_start/toc.yml b/website/get_start/toc.yml index 2d29464..4f6c699 100644 --- a/website/get_start/toc.yml +++ b/website/get_start/toc.yml @@ -8,7 +8,7 @@ href: use_client.md - name: Install agents - href: install_agents.md + href: Install_agents.md - name: Install OpenAI agent href: install_openai_agent.md \ No newline at end of file