{"id":1966,"date":"2024-01-23T15:09:02","date_gmt":"2024-01-23T23:09:02","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/semantic-kernel\/?p=1966"},"modified":"2024-01-23T15:09:02","modified_gmt":"2024-01-23T23:09:02","slug":"road-to-v1-0-for-the-python-semantic-kernel-sdk","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/agent-framework\/road-to-v1-0-for-the-python-semantic-kernel-sdk\/","title":{"rendered":"Road to v1.0 for the Python Semantic Kernel SDK"},"content":{"rendered":"<blockquote><p>Want to contribute to the Python SDK? Come join the Python Development Syncs every other Wednesday at 9 AM PST. <a href=\"https:\/\/aka.ms\/sk-community-calendar\">Click here to download the calendar invite<\/a>.<\/p><\/blockquote>\n<p>Last year, we finished shipping the v1.0.1 version of the .NET Semantic Kernel SDK. As part of this move, we made the SDK <em>much<\/em> easier to use while also increasing its power. We now have our eyes set on getting the Python and Java SDKs to parity with the .NET version. We believe this is important because many companies have both Python and .NET teams; by aligning the SDKs, developers can use the same concepts across languages.<\/p>\n<p>To provide visibility of these changes, we\u2019ve created the following content that outlines 1) the major changes coming to the Python SDK, 2) why we\u2019re making those changes, and 3) when we expect them to land.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/semantic-kernel\/wp-content\/uploads\/sites\/78\/2024\/01\/Untitled-98@2x.png\"><img decoding=\"async\" class=\"aligncenter size-large wp-image-1976\" src=\"https:\/\/devblogs.microsoft.com\/semantic-kernel\/wp-content\/uploads\/sites\/78\/2024\/01\/Untitled-98@2x-1024x130.png\" alt=\"Image Untitled 98 2x\" width=\"640\" height=\"81\" srcset=\"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-content\/uploads\/sites\/78\/2024\/01\/Untitled-98@2x-1024x130.png 1024w, https:\/\/devblogs.microsoft.com\/agent-framework\/wp-content\/uploads\/sites\/78\/2024\/01\/Untitled-98@2x-300x38.png 300w, https:\/\/devblogs.microsoft.com\/agent-framework\/wp-content\/uploads\/sites\/78\/2024\/01\/Untitled-98@2x-768x97.png 768w, https:\/\/devblogs.microsoft.com\/agent-framework\/wp-content\/uploads\/sites\/78\/2024\/01\/Untitled-98@2x-1536x194.png 1536w, https:\/\/devblogs.microsoft.com\/agent-framework\/wp-content\/uploads\/sites\/78\/2024\/01\/Untitled-98@2x-2048x259.png 2048w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>The major headline though is that we\u2019re targeting a Beta release (which should have <em>most<\/em> of the breaking changes) by the end of February with a full v1.0 release coming later this semester. If you ever want to see our progress, you can check out the remaining items we have on our <a href=\"https:\/\/github.com\/orgs\/microsoft\/projects\/866\/views\/3?sliceBy%5Bvalue%5D=python\">public backlog<\/a>.<\/p>\n<h2 style=\"margin-top: 2rem;\">How we\u2019re prioritizing the changes for Python<\/h2>\n<p>As we update the Python SDK, we&#8217;re focused on front-loading the significant breaking changes. This proactive approach is designed to minimize disruption for developers who want to use the Python SDK as soon as possible. On our <a href=\"https:\/\/github.com\/orgs\/microsoft\/projects\/866\/views\/3?sliceBy%5Bvalue%5D=python\">public backlog<\/a>, we\u2019ve labeled these changes as \u201curgent\u201d and they appear above the Beta cutline. Our goal is to complete these items before March.<\/p>\n<p>The remaining changes necessary to reach parity with .NET <em>may<\/em> introduce breaking changes, but they should be minimal in nature. On our backlog, we\u2019ve labeled these changes as \u201chigh\u201d.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/semantic-kernel\/wp-content\/uploads\/sites\/78\/2024\/01\/Screenshot-2024-01-23-at-1.43.03\u202fPM-copy-scaled.jpg\"><img decoding=\"async\" class=\"aligncenter size-large wp-image-1970\" src=\"https:\/\/devblogs.microsoft.com\/semantic-kernel\/wp-content\/uploads\/sites\/78\/2024\/01\/Screenshot-2024-01-23-at-1.43.03\u202fPM-copy-1024x557.jpg\" alt=\"Image Screenshot 2024 01 23 at 1 43 03 PM copy\" width=\"640\" height=\"348\" srcset=\"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-content\/uploads\/sites\/78\/2024\/01\/Screenshot-2024-01-23-at-1.43.03\u202fPM-copy-1024x557.jpg 1024w, https:\/\/devblogs.microsoft.com\/agent-framework\/wp-content\/uploads\/sites\/78\/2024\/01\/Screenshot-2024-01-23-at-1.43.03\u202fPM-copy-300x163.jpg 300w, https:\/\/devblogs.microsoft.com\/agent-framework\/wp-content\/uploads\/sites\/78\/2024\/01\/Screenshot-2024-01-23-at-1.43.03\u202fPM-copy-768x418.jpg 768w, https:\/\/devblogs.microsoft.com\/agent-framework\/wp-content\/uploads\/sites\/78\/2024\/01\/Screenshot-2024-01-23-at-1.43.03\u202fPM-copy-1536x836.jpg 1536w, https:\/\/devblogs.microsoft.com\/agent-framework\/wp-content\/uploads\/sites\/78\/2024\/01\/Screenshot-2024-01-23-at-1.43.03\u202fPM-copy-2048x1115.jpg 2048w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>Once we\u2019ve made the larger \u201curgent\u201d changes, it should be easier for contributors to create PRs on the SDK&#8217;s codebase. We\u2019ve already begun to label some features with \u201cneeds help\u201d to flag the issues we think should be straightforward enough for the community to work on. If you would like to contribute, please leave us a comment on any of these issues and we\u2019d be happy to help you make your first PR.<\/p>\n<h2 style=\"margin-top: 2rem;\">1. The enhancements coming with the Beta release<\/h2>\n<p>The upcoming Beta release of the Python SDK is all about setting a strong foundation so that future breaking changes are minimized. Because of this, you\u2019ll notice that many of the first issues we\u2019ll be working on are related to naming, control flow, and concept alignment with the .NET SDK.<\/p>\n<h3 style=\"margin-top: 1rem;\">1.1. Skills will finally become \u201cplugins\u201d<\/h3>\n<p>The shift from &#8216;skills&#8217; to &#8216;plugins&#8217; is already in flight. With the change, not only are we aligning our terminology to fit with the rest of the industry, but we\u2019re also adding an actual abstraction at the Skill\/Plugin level. This makes using plugins more modular so that they can be reused across multiple kernels. This will also simplify the current Python code that requires developers to juggle functions using <code>PluginCollection<\/code> and <code>ReadOnlyPluginCollection<\/code>.<\/p>\n<p><em>To see the status of this item, please refer to issue <a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/issues\/4560\">#4560<\/a>, <a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/issues\/4667\">#4667<\/a>, and <a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/issues\/4634\">#4634<\/a>.<\/em><\/p>\n<h3 style=\"margin-top: 1rem;\">1.2. <code>SKContext<\/code> will be replaced with\u00a0<code>KernelArguments<\/code><\/h3>\n<p>In the .NET library, we found that managing the previous context objects made using the kernel overwhelming to use. By replacing <code>SKContext<\/code> with <code>Kernel<\/code> and <code>KernelArguments<\/code>, we&#8217;re simplifying the interaction model, making it more intuitive while offering advanced features such as better state encapsulation, more granular control over execution, and easier access to kernel operations.<\/p>\n<p><em>To see the status of this item, please refer to issue <a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/issues\/4565\">#4565<\/a>.<\/em><\/p>\n<h3 style=\"margin-top: 1rem;\">1.3. We\u2019ll lay the foundation for multi-modal support<\/h3>\n<p>We believe that this year, there will be more and more models that support more than just text. For example, with GPT-4-vision, you can already provide images as inputs. Other models like Whisper allow you to generate audio. To support these different content types, we\u2019ll introduce the base <code>KernelContent<\/code> class from the .NET library. In the future, we\u2019ll extend it to support other content types like <code>ImageContent<\/code>, <code>VideoContent<\/code>, <code>AudioContent<\/code>, and more.<\/p>\n<p><em>To see the status of this item, please refer to issue <a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/issues\/4598\">#4598<\/a>.<\/em><\/p>\n<h3 style=\"margin-top: 1rem;\">1.4. The SDK will become more idiomatic<\/h3>\n<p>To deliver an SDK that resonates with Python developers, we&#8217;re reevaluating the interfaces and idioms to align with standard Python conventions. This includes removing view classes, removing _async where it\u2019s not necessary, and other changes so the SDK doesn\u2019t feel like a simple port of a .NET SDK.<\/p>\n<p><em>To see the status of this item, please refer to issue <a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/issues\/4628\">#4628<\/a> and <a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/issues\/4629\">#4629<\/a>.<\/em><\/p>\n<h2 style=\"margin-top: 2rem;\">2. The additional changes coming soon to Python<\/h2>\n<p>Following the Beta release, we plan to introduce additional features that will further enhance the power and usability of the SDK.<\/p>\n<h3 style=\"margin-top: 1rem;\">2.1. Complex type support<\/h3>\n<p>The current Python kernel only supports string input and outputs between functions. To fully integrate native code, however, we found that we needed to fully embrace all data types (including objects) in the .NET SDK. As part of this work, you\u2019ll soon be able to pass in any object type into the kernel as an argument.<\/p>\n<p><em>To see the status of this item, please refer to issue <a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/issues\/4635\">#4635<\/a>.<\/em><\/p>\n<h3 style=\"margin-top: 1rem;\">2.2. Enable automatic function calling<\/h3>\n<p>One of the best new features of the .NET SDK has been automatic function calling. With it, developers can avoid most of the boilerplate code necessary to build agents that automatically use plugins. This simplifies the interaction with AI services, making the development of sophisticated AI-powered applications more accessible.<\/p>\n<p><em>To see this in action in the .NET SDK, check out the <a href=\"https:\/\/learn.microsoft.com\/en-us\/semantic-kernel\/overview\/\">getting started example<\/a> on our learn site. To see the status of this item, please refer to issue <a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/issues\/4553\">#4553<\/a>.<\/em><\/p>\n<h3 style=\"margin-top: 1rem;\">2.3. Observe what\u2019s happening with kernel hooks<\/h3>\n<p>We&#8217;re introducing kernel hooks to offer developers windows into the kernel&#8217;s internal processes. These hooks will allow developers to attach custom logic to various events, such as pre-execution (invoking) or post-execution (invoked), providing a powerful tool for debugging, extending the kernel&#8217;s functionality, and enforcing responsible AI.<\/p>\n<p><em>To see this in action in the .NET SDK, check out the <a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/blob\/main\/dotnet\/samples\/KernelSyntaxExamples\/Example57_KernelHooks.cs\">hooks kernel syntax example<\/a>. To see the status of this item, please refer to issue <a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/issues\/3038\">#3038<\/a>.<\/em><\/p>\n<h3 style=\"margin-top: 1rem;\">2.4. Support chat roles in prompts<\/h3>\n<p>To make it easier for prompt engineers to author chat completion prompts in the .NET SDK, we added a new syntax to prompts to allow developers to add roles to their messages. We\u2019ll be adding the same syntax to Python so prompts can easily be shared between the two SDKs.<\/p>\n<p><em>To see this in action in the .NET SDK, check out the <a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/blob\/main\/dotnet\/samples\/KernelSyntaxExamples\/Example63_ChatCompletionPrompts.cs\">chat role kernel syntax example<\/a>. To see the status of this item, please refer to issue <a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/issues\/3318\">#3318<\/a>.<\/em><\/p>\n<h3 style=\"margin-top: 1rem;\">2.5. Register multiple supported models for a prompt<\/h3>\n<p>By allowing the registration of multiple models for a single prompt, the SDK will enable more adaptive and responsive AI interactions. Developers can optimize their applications to select the most suitable model based on the context, improving performance and user experience.<\/p>\n<h3 style=\"margin-top: 1rem;\">2.6. Introduce Gen 4 and Gen 5 planners<\/h3>\n<p>Lastly, we want introduce the Handlebars and Function Calling Stepwise planners to the Python SDK. These new planners have been proven to work faster and more reliability than the old planners, so we\u2019re excited to get them in the hands of our Python community.<\/p>\n<p><em>To learn more about our Gen 4 and Gen 5 planners, you can <a href=\"https:\/\/devblogs.microsoft.com\/semantic-kernel\/semantic-kernels-ignite-release-beta8-for-the-net-sdk\/#introducing-our-gen-4-and-gen-5-planners\">read about their launch here<\/a>. To see the status of this item, please refer to issue <a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/issues\/4641\">#4641<\/a> and <a href=\"https:\/\/github.com\/microsoft\/semantic-kernel\/issues\/4642\">#4642<\/a>.<\/em><\/p>\n<h2 style=\"margin-top: 2rem;\">That\u2019s not all!<\/h2>\n<p>There are many more features that are necessary for parity between Python and .NET; too many to include in this single blog post. If you\u2019re interested in seeing the full list, please <a href=\"https:\/\/github.com\/orgs\/microsoft\/projects\/866\/views\/3?sliceBy%5Bvalue%5D=python\">check out our backlog for Python<\/a>.<\/p>\n<p>By sharing our plans and progress transparently, we aim to build trust and facilitate a smooth transition to the v1.0 release. We&#8217;re excited to see how these changes will inspire developers to build innovative applications and contribute to the evolution of the Semantic Kernel SDK.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Want to contribute to the Python SDK? Come join the Python Development Syncs every other Wednesday at 9 AM PST. Click here to download the calendar invite. Last year, we finished shipping the v1.0.1 version of the .NET Semantic Kernel SDK. As part of this move, we made the SDK much easier to use while [&hellip;]<\/p>\n","protected":false},"author":121401,"featured_media":1980,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1966","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-semantic-kernel"],"acf":[],"blog_post_summary":"<p>Want to contribute to the Python SDK? Come join the Python Development Syncs every other Wednesday at 9 AM PST. Click here to download the calendar invite. Last year, we finished shipping the v1.0.1 version of the .NET Semantic Kernel SDK. As part of this move, we made the SDK much easier to use while [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/posts\/1966","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\/121401"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/comments?post=1966"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/posts\/1966\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/media\/1980"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/media?parent=1966"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/categories?post=1966"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/tags?post=1966"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}