{"id":4559,"date":"2025-03-24T16:53:47","date_gmt":"2025-03-24T23:53:47","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/semantic-kernel\/?p=4559"},"modified":"2025-03-25T01:00:34","modified_gmt":"2025-03-25T08:00:34","slug":"semantic-kernel-agent-framework-rc2","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/agent-framework\/semantic-kernel-agent-framework-rc2\/","title":{"rendered":"Semantic Kernel Agent Framework RC2"},"content":{"rendered":"<p>Three weeks ago we released the <a href=\"https:\/\/devblogs.microsoft.com\/semantic-kernel\/release-the-agents-sk-agents-framework-rc1\/\">Release the Agents! SK Agents Framework RC1 | Semantic Kernel <\/a>and we\u2019ve been thrilled to see the momentum grow. Thank you to everyone who has shared feedback, filed issues, and started building with agents in Semantic Kernel\u2014we\u2019re seeing more developers try agents than ever before.<\/p>\n<p class=\"\" data-start=\"650\" data-end=\"792\">Today, we\u2019re declaring <strong data-start=\"682\" data-end=\"703\">build 1.43 (.NET)<\/strong> and <strong data-start=\"708\" data-end=\"725\">1.26.1 (Python)<\/strong> as <strong data-start=\"729\" data-end=\"752\">Release Candidate 2<\/strong> of the Semantic Kernel Agent Framework.<\/p>\n<p class=\"\" data-start=\"794\" data-end=\"961\">With this release, we\u2019re introducing a <strong data-start=\"833\" data-end=\"863\">small but impactful change<\/strong> to how agents handle chat message threads \u2014one that sets the stage for powerful new capabilities coming soon.<\/p>\n<h2 class=\"\" data-start=\"963\" data-end=\"1017\">From <code data-start=\"971\" data-end=\"991\">ChatMessageContent<\/code> to <code data-start=\"995\" data-end=\"1017\">AgentResponseItem&lt;T&gt;<\/code><\/h2>\n<p class=\"\" data-start=\"1019\" data-end=\"1124\">In RC1, you would create a ChatHistory, add a ChatMessageContent, and when you called <code data-start=\"1043\" data-end=\"1058\">InvokeAsync()<\/code> on an agent with the ChatHistory, you received a <code data-start=\"1093\" data-end=\"1113\">ChatMessageContent<\/code> in return:<\/p>\n<pre class=\"prettyprint language-cs language-csharp\"><code class=\"language-cs language-csharp\">ChatHistory chat = [];\r\nChatMessageContent message = new(AuthorRole.User, \"What is the special soup and how much does it cost?\");\r\nchat.Add(message);\r\n\r\nawait foreach (ChatMessageContent response in agent.InvokeAsync(chat))\r\n{\r\n    chat.Add(response);\r\n    Console.WriteLine(response.Content);\r\n}<\/code><\/pre>\n<p>In RC2, <code data-start=\"1505\" data-end=\"1520\">InvokeAsync()<\/code> now returns an <code data-start=\"1536\" data-end=\"1575\">AgentResponseItem&lt;ChatMessageContent&gt;<\/code> instead, which has an AgentThread associated with it:<\/p>\n<pre class=\"prettyprint language-cs language-csharp\"><code class=\"language-cs language-csharp\">await foreach (AgentResponseItem&lt;ChatMessageContent&gt; response in agent.InvokeAsync(message, agentThread)) \/\/agentThread is optional\r\n{\r\n    agentThread = response.Thread\r\n    Console.WriteLine(response.Content)\r\n}<\/code><\/pre>\n<p>In python, this looks like:<\/p>\n<pre class=\"prettyprint language-py\"><code class=\"language-py\">response = await agent.get_response(\r\n            messages=user_input,\r\n            thread=thread, #optional\r\n        )\r\nprint(f\"# {response.name}: {response}\")\r\nthread = response.thread<\/code><\/pre>\n<p>The new common <code data-start=\"1505\" data-end=\"1520\">Invoke<\/code>\u00a0methods that we are introducing allow you to provide the message(s) that you want to pass to the agent and an optional <code data-start=\"1505\" data-end=\"1520\">AgentThread<\/code>. If an <code data-start=\"1505\" data-end=\"1520\">AgentThread<\/code> is provided, this will continue the conversation already on the <code data-start=\"1505\" data-end=\"1520\">AgentThread<\/code>. If no <code data-start=\"1505\" data-end=\"1520\">AgentThread<\/code>\u00a0is provided, a new default thread will be created and returned as part of the response. We&#8217;ve made this change across all of our agent types, ChatCompletion, AzureAIAgent, Bedrock and OpenAIAssistant.<\/p>\n<p>We have many samples using the new API pattern in our samples (<a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/tree\/main\/dotnet\/samples\/GettingStartedWithAgents\">C#<\/a>, <a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/tree\/main\/python\/samples\/getting_started_with_agents\">Python<\/a>).<\/p>\n<h2 class=\"\" data-start=\"2159\" data-end=\"2187\">Why Make This Change Now?<\/h2>\n<p class=\"\" data-start=\"2189\" data-end=\"2510\">We take platform stability seriously on the Semantic Kernel team. As we approach general availability, we carefully evaluated whether to introduce this breaking change in RC2. Ultimately, we decided that <strong data-start=\"2393\" data-end=\"2409\">doing it now<\/strong>\u2014before locking down the API\u2014is the right call to ensure long-term flexibility and developer clarity.<\/p>\n<p class=\"\" data-start=\"2512\" data-end=\"2595\">We\u2019ve designed this change to be easy to adopt, and we\u2019re here to help you migrate.<\/p>\n<h2 class=\"\" data-start=\"2597\" data-end=\"2612\">What\u2019s Next?<\/h2>\n<p class=\"\" data-start=\"2614\" data-end=\"2858\">We don\u2019t expect RC2 to stick around long\u2014we\u2019ll be evaluating this update over the next few days and listening to your feedback. Please let us know what you think on <a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/discussions\" target=\"_new\" rel=\"noopener\" data-start=\"2779\" data-end=\"2857\">GitHub Discussions<\/a>!<\/p>\n<p class=\"\" data-start=\"2860\" data-end=\"3110\">The General Availability (GA) release of the Agent Framework is just around the corner. In the meantime, try out RC2, explore the new return type, and stay tuned for announcements around <strong data-start=\"3047\" data-end=\"3068\">pluggable threads implementations<\/strong>, <strong data-start=\"3070\" data-end=\"3099\">multi-agent orchestration<\/strong>, and more.<\/p>\n<p class=\"\" data-start=\"3112\" data-end=\"3146\">Let\u2019s build great agents together.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Three weeks ago we released the Release the Agents! SK Agents Framework RC1 | Semantic Kernel and we\u2019ve been thrilled to see the momentum grow. Thank you to everyone who has shared feedback, filed issues, and started building with agents in Semantic Kernel\u2014we\u2019re seeing more developers try agents than ever before. Today, we\u2019re declaring build [&hellip;]<\/p>\n","protected":false},"author":173663,"featured_media":2808,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[27,17,1],"tags":[88],"class_list":["post-4559","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-agents","category-announcements","category-semantic-kernel","tag-agents"],"acf":[],"blog_post_summary":"<p>Three weeks ago we released the Release the Agents! SK Agents Framework RC1 | Semantic Kernel and we\u2019ve been thrilled to see the momentum grow. Thank you to everyone who has shared feedback, filed issues, and started building with agents in Semantic Kernel\u2014we\u2019re seeing more developers try agents than ever before. Today, we\u2019re declaring build [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/posts\/4559","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/users\/173663"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/comments?post=4559"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/posts\/4559\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/media\/2808"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/media?parent=4559"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/categories?post=4559"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/tags?post=4559"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}