.NET: [BREAKING] Rename GetNewSession to CreateSession (#3501)

* Rename GetNewSession to CreateSession

* Address copilot feedback

* Suppress warning

* Suppress warning

* Fix further warnings.
This commit is contained in:
westey
2026-02-03 11:33:50 +00:00
committed by GitHub
parent 405bd6fb4b
commit 6fdf6111e6
132 changed files with 277 additions and 261 deletions
@@ -37,11 +37,11 @@ var newAgent = await aiProjectClient.CreateAIAgentAsync(name: AssistantName, mod
var existingAgent = await aiProjectClient.GetAIAgentAsync(name: AssistantName, tools: [tool]);
// Non-streaming agent interaction with function tools.
AgentSession session = await existingAgent.GetNewSessionAsync();
AgentSession session = await existingAgent.CreateSessionAsync();
Console.WriteLine(await existingAgent.RunAsync("What is the weather like in Amsterdam?", session));
// Streaming agent interaction with function tools.
session = await existingAgent.GetNewSessionAsync();
session = await existingAgent.CreateSessionAsync();
await foreach (AgentResponseUpdate update in existingAgent.RunStreamingAsync("What is the weather like in Amsterdam?", session))
{
Console.WriteLine(update);