.NET: [BREAKING] Rename AgentThread to AgentSession (#3430)

* Rename AgentThread to AgentSession

* Add more renames

* Update readme files

* Revert nullable variable change and further fixes.

* Revert change in header name

* Fix some comments and tests

* Update changelog.

* Address PR feedback.

* Fixing code review comments.

* Fix new errors after merging latest code.
This commit is contained in:
westey
2026-01-26 16:30:25 +00:00
committed by GitHub
parent bbe096a764
commit a3a9147e61
223 changed files with 2529 additions and 2542 deletions
@@ -37,12 +37,12 @@ var newAgent = await aiProjectClient.CreateAIAgentAsync(name: AssistantName, mod
var existingAgent = await aiProjectClient.GetAIAgentAsync(name: AssistantName, tools: [tool]);
// Non-streaming agent interaction with function tools.
AgentThread thread = await existingAgent.GetNewThreadAsync();
Console.WriteLine(await existingAgent.RunAsync("What is the weather like in Amsterdam?", thread));
AgentSession session = await existingAgent.GetNewSessionAsync();
Console.WriteLine(await existingAgent.RunAsync("What is the weather like in Amsterdam?", session));
// Streaming agent interaction with function tools.
thread = await existingAgent.GetNewThreadAsync();
await foreach (AgentResponseUpdate update in existingAgent.RunStreamingAsync("What is the weather like in Amsterdam?", thread))
session = await existingAgent.GetNewSessionAsync();
await foreach (AgentResponseUpdate update in existingAgent.RunStreamingAsync("What is the weather like in Amsterdam?", session))
{
Console.WriteLine(update);
}