Files
Roger Barreto fa2a6af443 Bump Azure.AI.AgentServer.* packages and align Azure.Core/System.ClientModel (#6178)
* Bump Azure.AI.AgentServer.* package versions

* Align Azure.Core/System.ClientModel to AgentServer transitive deps

Bump Azure.Core 1.55->1.56 and System.ClientModel 1.11->1.12 to match Azure.AI.AgentServer.* requirements, and add explicit references in transitive-pinning-off Foundry consumers to avoid CS1705/MSB3277 version conflicts.
fa2a6af443 · 2026-05-29 19:42:07 +00:00
History
..

SessionFilesClient

A thin chat REPL that connects to a deployed Hosted-Files agent via FoundryAgent and lets you ask questions whose answers come from the files bundled with that agent. Same shape as SimpleAgent — point it at an AGENT_ENDPOINT, build a FoundryAgent, run.

The agent's container-side ListFiles and ReadFile tools surface the bundled file contents to the model. The client knows nothing about files; that is entirely the agent's concern.

Prerequisites

  • .NET 10 SDK
  • A running Hosted-Files agent (locally via dotnet run or deployed to Foundry)
  • Azure CLI logged in (az login)

Configuration

AZURE_AI_PROJECT_ENDPOINT=https://<host>/api/projects/<project>
AZURE_AI_AGENT_NAME=hosted-files

Both are required. AZURE_AI_PROJECT_ENDPOINT is the Foundry project endpoint URL and AZURE_AI_AGENT_NAME is the registered server-side agent name. The sample builds the per-agent OpenAI endpoint URL from these.

Run

cd dotnet/samples/04-hosting/FoundryHostedAgents/responses/Using-Samples/SessionFilesClient
$env:AZURE_AI_PROJECT_ENDPOINT = "http://localhost:8088/api/projects/local"
$env:AZURE_AI_AGENT_NAME = "hosted-files"
dotnet run

End-to-end demo

With the Hosted-Files agent running:

══════════════════════════════════════════════════════════
Session Files Client
Connected to: http://localhost:8088/
Try: "Give me the total revenue in the contoso file."
Type a message or 'quit' to exit
══════════════════════════════════════════════════════════

You> Give me the total revenue in the contoso file.
Agent> The contoso file reports total revenue of "$1,482.6M".

You> quit
Goodbye!

The agent looked at its bundled files via ListFiles, picked contoso_q1_2026_report.txt, called ReadFile, and quoted the figure verbatim. The client only sent a chat prompt.