From 7c9ed7f5d67488b60e62777e36479289833746fa Mon Sep 17 00:00:00 2001 From: Roger Barreto <19890735+rogerbarreto@users.noreply.github.com> Date: Thu, 16 Apr 2026 12:44:41 +0100 Subject: [PATCH] Remove FoundryResponsesRepl and empty FoundryResponsesHosting directory --- dotnet/agent-framework-dotnet.slnx | 1 - .../Properties/launchSettings.json | 12 -- .../FoundryResponsesRepl.csproj | 21 ---- .../FoundryResponsesRepl/Program.cs | 106 ------------------ .../Properties/launchSettings.json | 12 -- 5 files changed, 152 deletions(-) delete mode 100644 dotnet/samples/04-hosting/FoundryResponsesHosting/Properties/launchSettings.json delete mode 100644 dotnet/samples/04-hosting/FoundryResponsesRepl/FoundryResponsesRepl.csproj delete mode 100644 dotnet/samples/04-hosting/FoundryResponsesRepl/Program.cs delete mode 100644 dotnet/samples/04-hosting/FoundryResponsesRepl/Properties/launchSettings.json diff --git a/dotnet/agent-framework-dotnet.slnx b/dotnet/agent-framework-dotnet.slnx index 371dbbab8b..5cc3327b8d 100644 --- a/dotnet/agent-framework-dotnet.slnx +++ b/dotnet/agent-framework-dotnet.slnx @@ -261,7 +261,6 @@ - diff --git a/dotnet/samples/04-hosting/FoundryResponsesHosting/Properties/launchSettings.json b/dotnet/samples/04-hosting/FoundryResponsesHosting/Properties/launchSettings.json deleted file mode 100644 index b56d7a9ff4..0000000000 --- a/dotnet/samples/04-hosting/FoundryResponsesHosting/Properties/launchSettings.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "profiles": { - "FoundryResponsesHosting": { - "commandName": "Project", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "https://localhost:54747;http://localhost:54748" - } - } -} \ No newline at end of file diff --git a/dotnet/samples/04-hosting/FoundryResponsesRepl/FoundryResponsesRepl.csproj b/dotnet/samples/04-hosting/FoundryResponsesRepl/FoundryResponsesRepl.csproj deleted file mode 100644 index 15cdf820eb..0000000000 --- a/dotnet/samples/04-hosting/FoundryResponsesRepl/FoundryResponsesRepl.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - Exe - net10.0 - enable - enable - false - $(NoWarn);NU1903;NU1605 - - - - - - - - - - - - diff --git a/dotnet/samples/04-hosting/FoundryResponsesRepl/Program.cs b/dotnet/samples/04-hosting/FoundryResponsesRepl/Program.cs deleted file mode 100644 index 8b877dc519..0000000000 --- a/dotnet/samples/04-hosting/FoundryResponsesRepl/Program.cs +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. - -// Foundry Responses Client REPL -// -// Connects to a Foundry Responses agent running on a given endpoint -// and provides an interactive multi-turn chat REPL. -// -// Usage: -// dotnet run (connects to http://localhost:8088) -// dotnet run -- --endpoint http://localhost:9090 -// dotnet run -- --endpoint https://my-foundry-project.services.ai.azure.com -// -// The endpoint should be running a Foundry Responses server (POST /responses). - -using System.ClientModel; -using Microsoft.Agents.AI; -using OpenAI; -using OpenAI.Responses; - -// ── Parse args ──────────────────────────────────────────────────────────────── - -string endpointUrl = "http://localhost:8088"; -for (int i = 0; i < args.Length - 1; i++) -{ - if (args[i] is "--endpoint" or "-e") - { - endpointUrl = args[i + 1]; - } -} - -// ── Create an agent-framework agent backed by the remote Responses endpoint ── - -// The OpenAI SDK's ResponsesClient can target any OpenAI-compatible endpoint. -// We use a dummy API key since our local server doesn't require auth. -var credential = new ApiKeyCredential( - Environment.GetEnvironmentVariable("RESPONSES_API_KEY") ?? "no-key-needed"); - -var openAiClient = new OpenAIClient( - credential, - new OpenAIClientOptions { Endpoint = new Uri(endpointUrl) }); - -ResponsesClient responsesClient = openAiClient.GetResponsesClient(); - -// Wrap as an agent-framework AIAgent via the OpenAI extensions. -// We pass an empty model since hosted agents use their own model configuration. -AIAgent agent = responsesClient.AsAIAgent( - model: "", - name: "remote-agent"); - -// Create a session so multi-turn context is preserved via previous_response_id -AgentSession session = await agent.CreateSessionAsync(); - -// ── REPL ────────────────────────────────────────────────────────────────────── - -Console.ForegroundColor = ConsoleColor.Cyan; -Console.WriteLine("╔══════════════════════════════════════════════════════════╗"); -Console.WriteLine("║ Foundry Responses Client REPL ║"); -Console.WriteLine($"║ Connected to: {endpointUrl,-41}║"); -Console.WriteLine("║ Type a message or 'quit' to exit ║"); -Console.WriteLine("╚══════════════════════════════════════════════════════════╝"); -Console.ResetColor(); -Console.WriteLine(); - -while (true) -{ - Console.ForegroundColor = ConsoleColor.Green; - Console.Write("You> "); - Console.ResetColor(); - - string? input = Console.ReadLine(); - if (string.IsNullOrWhiteSpace(input)) - { - continue; - } - - if (input.Equals("quit", StringComparison.OrdinalIgnoreCase) || - input.Equals("exit", StringComparison.OrdinalIgnoreCase)) - { - break; - } - - try - { - Console.ForegroundColor = ConsoleColor.Yellow; - Console.Write("Agent> "); - Console.ResetColor(); - - // Stream the response token-by-token - await foreach (var update in agent.RunStreamingAsync(input, session)) - { - Console.Write(update); - } - - Console.WriteLine(); - } - catch (Exception ex) - { - Console.ForegroundColor = ConsoleColor.Red; - Console.WriteLine($"Error: {ex.Message}"); - Console.ResetColor(); - } - - Console.WriteLine(); -} - -Console.WriteLine("Goodbye!"); diff --git a/dotnet/samples/04-hosting/FoundryResponsesRepl/Properties/launchSettings.json b/dotnet/samples/04-hosting/FoundryResponsesRepl/Properties/launchSettings.json deleted file mode 100644 index 4a939fc693..0000000000 --- a/dotnet/samples/04-hosting/FoundryResponsesRepl/Properties/launchSettings.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "profiles": { - "FoundryResponsesRepl": { - "commandName": "Project", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "https://localhost:61980;http://localhost:61981" - } - } -} \ No newline at end of file