We’re excited to announce that with the release of Semantic Kernel 1.40 (.NET) and 1.22.0 (Python), we’re elevating the Semantic Kernel Agent Framework to Release Candidate 1. This marks a significant milestone in our journey toward providing a robust, versatile framework for building AI agents for enterprise applications.
Code Sample: Creating a Chat Agent with tool plugins
pip install semantic-kernel
# Define a sample plugin for the menu
class MenuPlugin:
  """A sample Menu Plugin used for the concept sample."""
  @kernel_function(description="Provides a list of specials from the menu.")
  def get_specials(self) -> Annotated[str, "Returns the specials from the menu."]:
    return """
    Special Soup: Clam Chowder
    Special Salad: Cobb Salad
    Special Drink: Chai Tea
    """
  @kernel_function(description="Provides the price of the requested menu item.")
  def get_item_price(
    self, menu_item: Annotated[str, "The name of the menu item."]
  ) -> Annotated[str, "Returns the price of the menu item."]:
    return "$9.99"
async def main():
  agent = ChatCompletionAgent(
    service=OpenAzureAIChatCompletion(),
    name="HostAgent",
    instructions="Answer questions about the menu.",
    plugins=[MenuPlugin()],
  )
  chat_history = ChatHistory()
  chat_history.add_user_message("What is the special soup and how much does it cost?")
  response = await agent.get_response(chat_history)
  print(f"# {response.name}: {response.content}")
dotnet add package Microsoft.SemanticKernel
dotnet add package Microsoft.SemanticKernel.Agents.core
dotnet add package Microsoft.SemanticKernel.core
dotnet add package Microsoft.SemanticKernel.Connectors.AzureOpenAI
var builder = Kernel.CreateBuilder();
builder.AddAzureOpenAIChatCompletion(
        Env.GetString("OPENAI_CHAT_MODEL_ID"),
        Env.GetString("OPENAI_API_KEY"));
var kernel = builder.Build();
ChatCompletionAgent agent = new()
{
  Instructions = "Answer questions about the menu.",
  Name = "HostAgent",
  Kernel = kernel,
  Arguments = new KernelArguments(new PromptExecutionSettings() {
    FunctionChoiceBehavior = FunctionChoiceBehavior.Auto()
  }),
};
agent.Kernel.Plugins.Add(KernelPluginFactory.CreateFromType<MenuPlugin>());
ChatHistory chat = [];
ChatMessageContent message = new(AuthorRole.User, "What is the special soup and how much does it cost?");
chat.Add(message);
await foreach (ChatMessageContent response in agent.InvokeAsync(chat))
{
  chat.Add(response);
  Console.WriteLine(response.Content);
  // Output: # Host: The special soup is Clam Chowder for $9.99.
}
You can see this full sample here: Chat Completion Agent with Plugins.
Multi-Provider Agent Support
- Azure AI Agent Service (C#, Python)
- AutoGen (Python)
- AWS Bedrock (C#, Python)
- Crew AI (C#, Python)
- OpenAI Assistants (C#, Python)
agent = AzureAIAgent(
  client=client,
  definition=agent_definition,
)
thread = await client.agents.create_thread()
… and the rest is the same!
What’s Next?
This Release Candidate represents a significant step forward in our commitment to providing a unified framework for AI agent development. We know that building a stable API is important for developing and deploying applications at scale.
We encourage you to try out these new capabilities and let us know what you think. Your input is invaluable as we work toward a full release in the coming weeks.
For more information, check out our documentation and examples on GitHub, and join the conversation in our community channels.
Next up, the team is focusing on integration with AutoGen to build amazing multi-agent systems! Stay tuned for more updates as we continue to evolve the Semantic Kernel Agent Framework.
0 comments
Be the first to start the discussion.