.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
Unverified
parent bbe096a764
commit a3a9147e61
223 changed files with 2529 additions and 2542 deletions
@@ -27,7 +27,7 @@ JsonSerializerOptions jsonSerializerOptions = JsonSerializerOptions.Default;
ServerFunctionApprovalClientAgent agent = new(baseAgent, jsonSerializerOptions);
List<ChatMessage> messages = [];
AgentThread? thread = null;
AgentSession? session = null;
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("Ask a question (or type 'exit' to quit):");
@@ -52,7 +52,7 @@ while ((input = Console.ReadLine()) != null && !input.Equals("exit", StringCompa
approvalResponses.Clear();
List<AgentResponseUpdate> chatResponseUpdates = [];
await foreach (AgentResponseUpdate update in agent.RunStreamingAsync(messages, thread, cancellationToken: default))
await foreach (AgentResponseUpdate update in agent.RunStreamingAsync(messages, session, cancellationToken: default))
{
chatResponseUpdates.Add(update);
foreach (AIContent content in update.Contents)