autogen/dotnet/website/tutorial/Use-AutoGen.Net-agent-as-model-in-AG-Studio.md
Step 2. Replace the Program.cs with following code  ```bash using AutoGen.Core; using AutoGen.Service;  var builder = WebApplication.CreateBuilder(args); var app = builder.Build();  var helloWorldAgent = new HelloWorldAgent(); app.UseAgentAsOpenAIChatCompletionEndpoint(helloWorldAgent);  app.Run();  class HelloWorldAgent : IAgent {     public string Name => "HelloWorld";      public Task<IMessage> GenerateReplyAsync(IEnumerable<IMessage> messages, GenerateReplyOptions? options = null, CancellationToken cancellationToken = default)     {         return Task.FromResult<IMessage>(new TextMessage(Role.Assistant, "Hello World!", from: this.Name));     } } ``` 