Release Notes
New Features
Important
Please review the updated migration guide for details on updating your agent-related code
Common Agent Invocation API
We introduced a new common abstraction to manage threads for all agents. For each agent we now expose a thread class that implements the AgentThread
base class, allowing context management via methods like create()
and delete()
.
Agent responses get_response(...)
, invoke(...)
, invoke_stream(...)
now return an AgentResponseItem[ChatMessageContent]
, which has two attributes:
message: TMessage # Usually ChatMessageContent
thread: AgentThread # Contains the concrete type for the given agent
It is still possible to get the content
, role
, or items
properties on the response
object:
for user_input in USER_INPUTS:
print(f"# User: {user_input}")
response = await agent.get_response(messages=user_input, thread=thread)
print(f"# {response.name}: {response}"
Agent Invocation Updates
Further, we have updated the previous message
keyword argument on all the agent get_response(...)
, invoke(...)
, and invoke_stream(...)
methods. The new argument is messages
which has the type str | ChatMessageContent | list[str | ChatMessageContent]
.
Agent Imports
All agent import paths have been consolidated under semantic_kernel.agents
.
Updated import style
from semantic_kernel.agents import (
AutoGenConversableAgent,
AzureAIAgent,
AzureAssistantAgent,
BedrockAgent,
ChatCompletionAgent,
OpenAIAssistantAgent,
)
Previous import style (deprecated):
from semantic_kernel.agents import ChatCompletionAgent
from semantic_kernel.agents.autogen import AutoGenConversableAgent
from semantic_kernel.agents.azure_ai import AzureAIAgent
from semantic_kernel.agents.bedrock import BedrockAgent
from semantic_kernel.agents.open_ai import AzureAssistantAgent, OpenAIAssistantAgent
Enhancements and Improvements
- Python: Update README.md by @jun216tee in #11024
- Python: Exclude certain fields from KernelFunction model dump by @moonbox3 in #11081
- Python: removed old search plugins by @eavanvalkenburg in #11035
- Python: Add Copilot Studio Agents and Copilot Studio Skill demos by @unsafecode in #11006
Bug Fixes
- Python: Fix agent_id kwarg in AzureAIAgent retrieval sample by @moonbox3 in #11057
- Python: Pass api_key to azure config base init by @moonbox3 in #11056
Python Package Updates
- Python: Unit tests for ollama services utils and dapr_actor_registration by @rracanicci in #10849
New Contributors
- @jun216tee made their first contribution in #11024
- @unsafecode made their first contribution in #11006
Full Changelog: python-1.25.0...python-1.26.0