Skip to content

🌟 Semantic Kernel Intro Agents Build interactive, intelligent agents with Semantic Kernel and Azure OpenAI! πŸ€– Features include real-time AI chat, πŸ“° news retrieval via NewsPlugin, and πŸ’Ύ data archival with ArchivePlugin. Extensible, powerful, and perfect for exploring modern AI workflows. πŸš€

License

Notifications You must be signed in to change notification settings

sundog358/sk-intro-agents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌟 Semantic Kernel Intro Agents 🌟

Welcome to the Semantic Kernel Intro Agents project! This application demonstrates how to build interactive, intelligent agents using Semantic Kernel and Azure OpenAI. πŸŽ‰ With plugins like NewsPlugin for fetching the latest news and ArchivePlugin for data storage, this project showcases extensible and powerful AI functionality for real-world applications. πŸš€


πŸš€ Features

  • πŸ€– Interactive AI Chat: Engage with an AI agent in real-time, powered by Azure OpenAI's GPT models.
  • πŸ“° News Retrieval: Stay informed with the latest news headlines using the NewsPlugin.
  • πŸ’Ύ Data Archival: Save conversation history or other data locally with the ArchivePlugin.
  • πŸ”§ Extensibility: Designed for flexibilityβ€”easily add custom plugins or extend existing ones.
  • πŸ“œ Real-Time Streaming Responses: Enjoy smooth, streaming responses during chat interactions.

πŸ“‹ Requirements

Before running the project, ensure you have the following:

  • βœ… .NET 8.0 SDK: Download here.
  • βœ… Azure OpenAI Credentials:
    • Deployment Name: The name of your deployed Azure OpenAI model.
    • Endpoint URL: The endpoint for your Azure OpenAI service.
    • API Key: The authentication key for accessing Azure OpenAI.
  • βœ… Configuration:
    • Populate the appsettings.json file with your Azure OpenAI credentials.

πŸ› οΈ How It Works

Program Overview

  1. Configuration Loading:

    • The application reads Azure OpenAI credentials (DeploymentName, Endpoint, ApiKey) from appsettings.json for secure configuration management.
  2. Semantic Kernel Setup:

    • A Kernel Builder is initialized to configure the Semantic Kernel environment.
    • The Azure OpenAI service is integrated as a chat completion backend.
  3. Plugins:

    • The application integrates plugins to expand functionality:
      • NewsPlugin: Retrieves news headlines from the New York Times RSS feeds.
      • ArchivePlugin: Saves runtime data to local storage for later use.
  4. Interactive Loop:

    • Users input prompts, and the AI agent responds in real-time.
    • Chat history is maintained to ensure context-aware conversations.
  5. Streaming Responses:

    • The AI responses are streamed for a smoother user experience, displaying the output as it is generated.

πŸ“‚ Project Structure

C:\Users\rsung\OneDrive\Desktop\AIResearch\semantickernel\sk-intro-agents
β”œβ”€β”€ .gitignore                       # Git ignore rules
β”œβ”€β”€ README.md                        # Project documentation
β”œβ”€β”€ sk-intro-agents.sln              # Solution file
β”œβ”€β”€ notebooks/                       # Jupyter notebooks (optional)
β”œβ”€β”€ src/                             # Source code directory
β”‚   β”œβ”€β”€ appsettings.Development.json # Environment-specific config
β”‚   β”œβ”€β”€ appsettings.json             # Main configuration file
β”‚   β”œβ”€β”€ ArchivePlugin.cs             # Plugin for data archival
β”‚   β”œβ”€β”€ NewsPlugin.cs                # Plugin for fetching news
β”‚   β”œβ”€β”€ Program.cs                   # Main entry point
β”‚   β”œβ”€β”€ sk-intro-agents.csproj       # Project configuration
β”‚   β”œβ”€β”€ archives/                    # Archived runtime-generated data
β”‚   β”œβ”€β”€ bin/                         # Build output (auto-generated)
β”‚   └── obj/                         # Build object files (auto-generated)

πŸ”Œ Plugins

πŸ“° NewsPlugin

  • Purpose: Fetches top news articles from the New York Times RSS feed for a specified category.
  • Key Features:
    • Retrieves up to 10 news items.
    • Uses the SimpleFeedReader library for RSS feed parsing.
  • Sample Input: tech
  • Sample Output:
  1. TikTok Faces U.S. Ban After Losing Bid to Overturn New Law
  2. Bitcoin Price Surges to a Milestone: $100,000

πŸ’Ύ ArchivePlugin

  • Purpose: Saves conversation data or any runtime information to local storage.

  • Key Features:

  • Writes data into text files in the archives/ folder.

  • Useful for maintaining logs or preserving user interactions.

Output Example:

Data is saved as C:\archives<filename>.txt.

πŸ”§ Configuration Details:

Edit the appsettings.json file in the src/ directory to include your Azure OpenAI credentials:

{
  "AzureOpenAI": {
    "DeploymentName": "your-deployment-name",
    "Endpoint": "https://your-endpoint.azure.com",
    "ApiKey": "your-api-key"
  }
}

πŸ–₯️ How to Run

  1. Clone the Repository

git clone <repository-url> cd sk-intro-agents

  1. Restore Dependencies

dotnet restore

  1. Build the Project

dotnet build

  1. Run the Application

dotnet run

πŸ–±οΈ Interact with the AI

  • Prompt: Enter hi or tech news please.

  • Response: The AI will respond in real-time with interactive, context-aware replies.

Prompt: hi
Response: Hello! How can I assist you today?

Prompt: tech news please
Response: Here are some of the latest updates in the technology sector:
1. TikTok Faces U.S. Ban After Losing Bid to Overturn New Law
2. Bitcoin Price Surges to a Milestone: $100,000

πŸŽ‰ Enjoy exploring the capabilities of Semantic Kernel Intro Agents! πŸš€

About

🌟 Semantic Kernel Intro Agents Build interactive, intelligent agents with Semantic Kernel and Azure OpenAI! πŸ€– Features include real-time AI chat, πŸ“° news retrieval via NewsPlugin, and πŸ’Ύ data archival with ArchivePlugin. Extensible, powerful, and perfect for exploring modern AI workflows. πŸš€

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published