Files
agent-framework/dotnet/samples/A2AClientServer/A2AClient
Ren Finlayson 539852f81c
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
dotnet-build-and-test / paths-filter (push) Waiting to run
dotnet-build-and-test / dotnet-build-and-test (Debug, windows-latest, net9.0) (push) Blocked by required conditions
dotnet-build-and-test / dotnet-build-and-test (Release, integration, true, ubuntu-latest, net10.0) (push) Blocked by required conditions
dotnet-build-and-test / dotnet-build-and-test (Release, integration, true, windows-latest, net472) (push) Blocked by required conditions
dotnet-build-and-test / dotnet-build-and-test (Release, ubuntu-latest, net8.0) (push) Blocked by required conditions
dotnet-build-and-test / dotnet-build-and-test-check (push) Blocked by required conditions
test
2026-01-24 03:05:12 +11:00
..
2026-01-24 03:05:12 +11:00
2026-01-24 03:05:12 +11:00
2026-01-24 03:05:12 +11:00
2026-01-24 03:05:12 +11:00

A2A Client Sample

Show how to create an A2A Client with a command line interface which invokes agents using the A2A protocol.

Run the Sample

To run the sample, follow these steps:

  1. Run the A2A client:
    cd A2AClient
    dotnet run
    
  2. Enter your request e.g. "Show me all invoices for Contoso?"

Set Environment Variables

The agent urls are provided as a delimited list of strings

cd dotnet/samples/A2AClientServer/A2AClient

$env:OPENAI_MODEL="gpt-4o-mini"
$env:OPENAI_API_KEY="<Your OPENAI api key>"
$env:AGENT_URLS="http://localhost:5000/policy;http://localhost:5000/invoice;http://localhost:5000/logistics"