github microsoft/semantic-kernel python-1.22.0

latest release: dotnet-1.40.0-nightly-250227.3
one day ago

Release Notes

New Features

  • Python: Agent get_response API by @TaoChenOSU in #10701

    We've simplified our APIs to make it easier to quickly get started with agents. You can now directly retrieve an agent response using:

    response = await agent.get_response(chat_history)

    This new API complements the existing invoke and invoke_stream methods you may already be using.

  • Python: Allow plugins via agent constructors. Update samples. by @moonbox3 in #10707

    We've streamlined the way plugins and services can be added to agents. You no longer need to separately define a kernel and manually add plugins before constructing an agent. The simplified constructor looks like this:

    agent = ChatCompletionAgent(
        service=AzureChatCompletion(),
        instructions="Answer questions about the world.",
        plugins=[SamplePlugin()],
    )

    This update enhances usability as we approach our release candidate. The previous approach remains valid, but this new method offers improved simplicity. Please refer to the migration guide for details on updating to SK 1.22.0+.

    The old way is still valid, but this is a much more streamlined approach.

  • Python: Add support for AutoGen's 0.2 ConversableAgent by @moonbox3 in #10607

    Semantic Kernel Python now supports integration with AutoGen 0.2's ConversableAgent, enabling seamless use within the SK ecosystem:

    from autogen import ConversableAgent
    from semantic_kernel.agents.autogen.autogen_conversable_agent import AutoGenConversableAgent
    
    async def main():
        cathy = ConversableAgent(
            "cathy",
            system_message="Your name is Cathy and you are a part of a duo of comedians.",
            llm_config={
                "config_list": [
                    {
                        "model": os.environ["OPENAI_CHAT_MODEL_ID"],
                        "temperature": 0.9,
                        "api_key": os.environ.get("OPENAI_API_KEY"),
                    }
                ]
            },
            human_input_mode="NEVER",  # Never ask for human input.
        )
    
        cathy_autogen_agent = AutoGenConversableAgent(conversable_agent=cathy)
    
        joe = ConversableAgent(
            "Joe",
            system_message="Your name is Joe and you are a part of a duo of comedians.",
            llm_config={
                "config_list": [
                    {
                        "model": os.environ["OPENAI_CHAT_MODEL_ID"],
                        "temperature": 0.7,
                        "api_key": os.environ.get("OPENAI_API_KEY"),
                    }
                ]
            },
            human_input_mode="NEVER",  # Never ask for human input.
        )
    
        joe_autogen_agent = AutoGenConversableAgent(conversable_agent=joe)
    
        async for content in cathy_autogen_agent.invoke(
            recipient=joe_autogen_agent, message="Tell me a joke about the stock market.", max_turns=3
        ):
            print(f"# {content.role} - {content.name or '*'}: '{content.content}'")
    
    
    if __name__ == "__main__":
        asyncio.run(main())
  • Python: Introducing AzureCosmosDBforMongoDB store and collection by @eavanvalkenburg in #10609

  • Python: Introducing the Chroma Connector with the new vector store design by @eavanvalkenburg in #10678

  • Python: Introduce feature decorator to allow for experimental and release candidate decorator usage by @moonbox3 in #10691

Python Package Updates

  • Python: Update boto3 requirement from ~=1.36.4 to >=1.36.4,<1.38.0 in /python by @dependabot in #10660
  • Python: Bump Python version to 1.22.0 for a release. by @moonbox3 in #10718

Enhancements and Fixes

  • Python: Improve/Simplify the Assistant Agents by @moonbox3 in #10666

    We’ve significantly enhanced our AzureAssistantAgent and OpenAIAssistantAgent classes to improve scalability and flexibility. Developers now have direct access to the underlying client and assistant model configurations. Note: this update introduces breaking changes for those upgrading from versions prior to 1.22.0. Please consult our migration guide to assist with the transition.

  • Python: Improve agent getting started samples by @TaoChenOSU in #10667

  • Python: improve feature decorator return type so it doesn't affect Pylance by @moonbox3 in #10704

  • Python: lazy create stores in integration tests by @eavanvalkenburg in #10705

Bug Fixes and Improvements

Full Changelog: python-1.21.3...python-1.22.0

Don't miss a new semantic-kernel release

NewReleases is sending notifications on new releases.