This solution contains two .NET console applications that demonstrate the power of Microsoft Semantic Kernel for AI-powered applications:
- SemanticPizza - An interactive pizza ordering chatbot with function calling capabilities
- SemanticMarketing - A multi-agent marketing campaign generator using AI agents
- .NET 8.0 SDK or later
- Azure OpenAI Service account with a deployed model
- Visual Studio, Visual Studio Code, or JetBrains Rider (optional)
git clone <your-repository-url>
cd SemanticPizzaBoth projects require Azure OpenAI configuration. You'll need to set up your Azure OpenAI credentials in one of two ways:
Update the appsettings.json files in both SemanticPizza/ and SemanticMarketing/ directories:
{
"AzureOpenAI": {
"Endpoint": "https://your-openai-resource.openai.azure.com/",
"ApiKey": "your-api-key-here",
"DeploymentName": "your-deployment-name"
}
}For one of the projects, run the following commands to store your credentials securely. Both projects will use the same user secrets configuration.
# For SemanticPizza
cd SemanticPizza
dotnet user-secrets set "AzureOpenAI:Endpoint" "https://your-openai-resource.openai.azure.com/"
dotnet user-secrets set "AzureOpenAI:ApiKey" "your-api-key-here"
dotnet user-secrets set "AzureOpenAI:DeploymentName" "your-deployment-name"
# For SemanticMarketing
cd ../SemanticMarketing
dotnet user-secrets set "AzureOpenAI:Endpoint" "https://your-openai-resource.openai.azure.com/"
dotnet user-secrets set "AzureOpenAI:ApiKey" "your-api-key-here"
dotnet user-secrets set "AzureOpenAI:DeploymentName" "your-deployment-name"From the solution root directory:
dotnet restoreThe SemanticPizza project demonstrates function calling with AI, allowing users to interact with a pizza ordering system through natural language.
Features:
- Natural language pizza ordering
- Function calling for menu operations
- Interactive chat interface
- Custom pizza plugins
To run:
cd SemanticPizza
dotnet runExample interactions:
- "I'd like to order a large pepperoni pizza"
- "What pizza options do you have?"
- "Add a medium margherita to my order"
- Type 'exit' to quit
The SemanticMarketing project showcases multi-agent AI orchestration with two AI agents working together to create and approve marketing campaigns.
Features:
- Multi-agent AI system
- Creative Director agent for campaign ideas
- Marketing Manager agent for approval workflow
- Group chat orchestration
- Approval-based conversation flow
To run:
cd SemanticMarketing
dotnet runExample usage:
- Enter a marketing brief (e.g., "Create a summer promotion campaign for our pizza restaurant")
- Watch as the Creative Director generates ideas
- See the Marketing Manager provide feedback
- The conversation continues until the Marketing Manager approves the campaign
SemanticPizza/
├── README.md
├── SemanticPizza.sln
├── SemanticPizza/
│ ├── Program.cs # Main pizza ordering application
│ ├── SemanticPizza.csproj
│ ├── appsettings.json
│ ├── Model/
│ │ └── MenuItem.cs # Pizza menu item model
│ └── Plugins/
│ ├── PizzaPlugin.cs # Custom pizza functions
│ └── Prompts/
│ ├── config.json # Prompt configuration
│ └── skprompt.txt # Prompt template
└── SemanticMarketing/
├── Program.cs # Main marketing agents application
├── SemanticMarketing.csproj
├── appsettings.json
├── ApprovalGroupChatManager.cs # Custom chat manager
└── OpenAIConfiguration.cs # Configuration model
- Microsoft Semantic Kernel 1.56.0 - AI orchestration framework
- Azure OpenAI - Large language models
- Microsoft Semantic Kernel Agents - Multi-agent AI systems
- .NET 8.0 - Application framework
- User Secrets - Secure configuration management
-
"ArgumentNullException: OpenAI configuration is null"
- Ensure your Azure OpenAI credentials are properly configured
- Verify the configuration section name matches "AzureOpenAI"
-
"Unauthorized" or "401" errors
- Check your Azure OpenAI API key is correct
- Verify your endpoint URL is properly formatted
- Ensure your deployment name matches the actual deployment
-
"Model not found" errors
- Confirm your deployment name is correct
- Verify the model is deployed and running in your Azure OpenAI resource
-
Function calling not working in SemanticPizza
- Ensure you're using a model that supports function calling (GPT-3.5-turbo or GPT-4)
- Check that the
FunctionChoiceBehavior.Required()setting is properly configured
This project is provided as-is for educational and demonstration purposes.