From 043903bf88a2c18d516485b0b36613b37b81e515 Mon Sep 17 00:00:00 2001 From: ktz03 <2484593937@qq.com> Date: Fri, 23 Oct 2026 17:39:36 +0800 Subject: [PATCH] .NET: Correct endpoint override instructions in Responses samples --- .../04-hosting/af-hosting/local_responses/Server/Program.cs | 2 +- .../04-hosting/af-hosting/local_responses/Server/README.md | 5 +++-- .../af-hosting/local_responses_workflow/Server/Program.cs | 2 +- .../af-hosting/local_responses_workflow/Server/README.md | 4 +++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/dotnet/samples/04-hosting/af-hosting/local_responses/Server/Program.cs b/dotnet/samples/04-hosting/af-hosting/local_responses/Server/Program.cs index d6f5c81a145..bd776f5b38d 100644 --- a/dotnet/samples/04-hosting/af-hosting/local_responses/Server/Program.cs +++ b/dotnet/samples/04-hosting/af-hosting/local_responses/Server/Program.cs @@ -113,7 +113,7 @@ static string LookupWeather([Description("The city to look up weather for.")] st }); // Bind to a fixed local URL so the paired client sample has a deterministic default. -// Override with the ASPNETCORE_URLS environment variable when needed. +// To use a different address, change the URL below and set RESPONSES_SERVER_URL in the client. app.Run("http://localhost:5000"); // Application-owned trust decision. Replace with real authentication + authorization: verify the caller, diff --git a/dotnet/samples/04-hosting/af-hosting/local_responses/Server/README.md b/dotnet/samples/04-hosting/af-hosting/local_responses/Server/README.md index e1faafb7278..880d19f5a4f 100644 --- a/dotnet/samples/04-hosting/af-hosting/local_responses/Server/README.md +++ b/dotnet/samples/04-hosting/af-hosting/local_responses/Server/README.md @@ -25,8 +25,9 @@ The route persists each turn under a continuation id chosen by how the caller co under the newly minted response id, so a later `previous_response_id` can branch from that exact point and two branches from the same prior response stay independent. -The agent has a deterministic `lookup_weather` tool. Binds to `http://localhost:5000` (override with -`ASPNETCORE_URLS`). +The agent has a deterministic `lookup_weather` tool. Binds to `http://localhost:5000`. To use a different address, +change the URL passed to `app.Run` in `Program.cs` and set `RESPONSES_SERVER_URL` to the same address +in the client shell. ```bash export FOUNDRY_PROJECT_ENDPOINT="https://.services.ai.azure.com/api/projects/" diff --git a/dotnet/samples/04-hosting/af-hosting/local_responses_workflow/Server/Program.cs b/dotnet/samples/04-hosting/af-hosting/local_responses_workflow/Server/Program.cs index c28aadfba66..a61540d788c 100644 --- a/dotnet/samples/04-hosting/af-hosting/local_responses_workflow/Server/Program.cs +++ b/dotnet/samples/04-hosting/af-hosting/local_responses_workflow/Server/Program.cs @@ -118,7 +118,7 @@ static Workflow BuildWorkflow(AIAgent writer) }); // Bind to a fixed local URL so the paired client sample has a deterministic default. -// Override with the ASPNETCORE_URLS environment variable when needed. +// To use a different address, change the URL below and set RESPONSES_SERVER_URL in the client. app.Run("http://localhost:5001"); // Flattens the Responses input messages into a single brief string for the workflow's start executor. diff --git a/dotnet/samples/04-hosting/af-hosting/local_responses_workflow/Server/README.md b/dotnet/samples/04-hosting/af-hosting/local_responses_workflow/Server/README.md index 3fd92e18a4f..b188dff23ca 100644 --- a/dotnet/samples/04-hosting/af-hosting/local_responses_workflow/Server/README.md +++ b/dotnet/samples/04-hosting/af-hosting/local_responses_workflow/Server/README.md @@ -11,7 +11,9 @@ This server supports **`previous_response_id` continuation only** and **rejects with HTTP 400**. Because `previous_response_id` rotates every turn, the app owns a cursor that maps each response id to the stable workflow session id, so the whole rotating chain resumes the same checkpointed run. The first turn runs the workflow forward; later turns restore the latest checkpoint and run forward -with the new brief. Binds to `http://localhost:5001` (override with `ASPNETCORE_URLS`). +with the new brief. Binds to `http://localhost:5001`. To use a different address, +change the URL passed to `app.Run` in `Program.cs` and set `RESPONSES_SERVER_URL` to the same address +in the client shell. `HostedWorkflowState` is constructed with a **workflow factory** and `cacheWorkflow: false` (the default, shown explicitly), so it builds a fresh workflow instance for every run. This lets independent sessions run