Shows how to build a stateful agent conversation using AgentSession. A travel-planning agent uses a custom tool to suggest destinations across multiple sequential turns, demonstrating how session context is preserved between calls.
- Creating and managing an
AgentSessionfor multi-turn conversations - Registering and invoking a C# function as an agent tool
- How the agent autonomously decides when to call a tool based on user input
- .NET 10 SDK
- A GitHub Models personal access token
dotnet user-secrets set "GITHUB_TOKEN" "<your-github-pat>"
dotnet user-secrets set "GITHUB_ENDPOINT" "https://models.inference.ai.azure.com"
dotnet user-secrets set "GITHUB_MODEL_ID" "gpt-4o-mini"dotnet rundotnet run app.cs